Created
August 8, 2013 12:09
-
-
Save peerasak-u/6184064 to your computer and use it in GitHub Desktop.
How to Check if an NSDate occurs between two other NSDates ?
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
| + (BOOL)date:(NSDate*)date isBetweenDate:(NSDate*)beginDate andDate:(NSDate*)endDate | |
| { | |
| if ([date compare:beginDate] == NSOrderedAscending) | |
| return NO; | |
| if ([date compare:endDate] == NSOrderedDescending) | |
| return NO; | |
| return YES; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment