Created
August 7, 2014 12:28
-
-
Save looping/58d4f2bddd388b46fc87 to your computer and use it in GitHub Desktop.
Days remaining in current month
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSInteger daysRemainInCurrentMonth () { | |
return ([[NSCalendar currentCalendar] rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate:[NSDate date]].length - [[({NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"dd"]; formatter;}) stringFromDate:[NSDate date]] integerValue]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment