#177: method to format dates

This commit is contained in:
Patrick Santana 2013-05-17 22:16:00 +02:00
parent fe451963c2
commit 9e542fe382
2 changed files with 6 additions and 3 deletions

View file

@ -21,6 +21,6 @@
@interface DateUtilities : NSObject
+ (int)daysBetween:(NSDate*) dt1 and:(NSDate*) dt2;
+ (NSString*) formatDatePhoto:(NSDate*) date;
+ (NSString*) formatDate:(NSDate*) date;
@end

View file

@ -30,9 +30,12 @@
return [components day]+1;
}
+ (NSString *) formatDatePhoto:(NSDate *) date
+ (NSString *) formatDate:(NSDate *) date
{
return nil;
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateStyle:NSDateFormatterMediumStyle];
[dateFormat setTimeStyle:NSDateFormatterShortStyle];
return [dateFormat stringFromDate:date];
}
@end