Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

potentially helpful :)

  • Loading branch information...
commit 96aa405878d9fc38d566b3d567170e5c6fd1b621 1 parent 4a4085a
Stas Sviridenko authored
Showing with 5 additions and 0 deletions.
  1. +1 −0  MyDay/NSDate+TimeUtils.h
  2. +4 −0 MyDay/NSDate+TimeUtils.m
1  MyDay/NSDate+TimeUtils.h
View
@@ -10,6 +10,7 @@
- (BOOL)isSameDayWithDate:(NSDate *)date;
- (BOOL)isNextDayAfterDate:(NSDate *)date;
+- (BOOL)isBeforeDate:(NSDate *)date;
- (NSString *)formatShort;
- (NSString *)formatMiddle;
4 MyDay/NSDate+TimeUtils.m
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]];
Please sign in to comment.
Something went wrong with that request. Please try again.