Permalink
Browse files

potentially helpful :)

  • Loading branch information...
1 parent 4a4085a commit 96aa405878d9fc38d566b3d567170e5c6fd1b621 Stas Sviridenko committed Apr 5, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 MyDay/NSDate+TimeUtils.h
  2. +4 −0 MyDay/NSDate+TimeUtils.m
View
@@ -10,6 +10,7 @@
- (BOOL)isSameDayWithDate:(NSDate *)date;
- (BOOL)isNextDayAfterDate:(NSDate *)date;
+- (BOOL)isBeforeDate:(NSDate *)date;
- (NSString *)formatShort;
- (NSString *)formatMiddle;
View
@@ -40,6 +40,10 @@ - (BOOL)isNextDayAfterDate:(NSDate *)date {
return [self isSameDayWithDate:tomorrow];
}
+- (BOOL)isBeforeDate:(NSDate *)date {
+ return [self compare:date] == NSOrderedAscending;
+}
+
- (NSDate *)onlyTime {
NSCalendar *calendar = [NSCalendar currentCalendar];
return [calendar dateFromComponents:[self timeComponents]];

0 comments on commit 96aa405

Please sign in to comment.