Skip to content

Commit

Permalink
- Added default locale to formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt York committed Mar 23, 2014
1 parent c16bd28 commit c4f10b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DateTools/NSDate+DateTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ -(BOOL)isLaterThanOrEqualTo:(NSDate *)date{
-(NSString *)formattedDateWithStyle:(NSDateFormatterStyle)style{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:style];
[formatter setLocale:[NSLocale currentLocale]];
return [formatter stringFromDate:self];
}

Expand Down Expand Up @@ -1376,6 +1377,7 @@ -(NSString *)formattedDateWithStyle:(NSDateFormatterStyle)style timeZone:(NSTime
-(NSString *)formattedDateWithFormat:(NSString *)format{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:format];
[formatter setLocale:[NSLocale currentLocale]];
return [formatter stringFromDate:self];
}

Expand Down

0 comments on commit c4f10b2

Please sign in to comment.