Permalink
Browse files

Should localize date base on user's region

  • Loading branch information...
1 parent 10a34d4 commit 7e51010abca475673583d54363baa6da2c5f91d7 @nikreiman nikreiman committed May 30, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m
@@ -112,14 +112,14 @@ - (void)refreshLastUpdatedDate {
NSDate *date = [_delegate egoRefreshTableHeaderDataSourceLastUpdated:self];
- NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
- [formatter setAMSymbol:@"AM"];
- [formatter setPMSymbol:@"PM"];
- [formatter setDateFormat:@"MM/dd/yyyy hh:mm:a"];
- _lastUpdatedLabel.text = [NSString stringWithFormat:@"Last Updated: %@", [formatter stringFromDate:date]];
+ [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehaviorDefault];
+ NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
+ [dateFormatter setDateStyle:NSDateFormatterShortStyle];
+ [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
+
+ _lastUpdatedLabel.text = [NSString stringWithFormat:@"Last Updated: %@", [dateFormatter stringFromDate:date]];
[[NSUserDefaults standardUserDefaults] setObject:_lastUpdatedLabel.text forKey:@"EGORefreshTableView_LastRefresh"];
[[NSUserDefaults standardUserDefaults] synchronize];
- [formatter release];
} else {

0 comments on commit 7e51010

Please sign in to comment.