NSDateComponents
and NSCalendar
have a feature to get the n'th weekday of the month with the NSWeekdayOrdinalCalendarUnit
using NSCalendarUnit
.
For example the 2nd monday of the month.
It's awesome but, I need to check if a certain instance of NSDate
is the last or second last weekday of the month. I can't think of a neat way to do this. I hope there is a simple trick that does not require you to loop through all the mondays of the whole month.
Do you guys have any ideas?