Skip to content

Instantly share code, notes, and snippets.

@peerasak-u
Created August 8, 2013 12:09
Show Gist options
  • Select an option

  • Save peerasak-u/6184064 to your computer and use it in GitHub Desktop.

Select an option

Save peerasak-u/6184064 to your computer and use it in GitHub Desktop.
How to Check if an NSDate occurs between two other NSDates ?
+ (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