Skip to content

Commit

Permalink
Clean up use of timeformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
duemunk committed Jan 1, 2015
1 parent dba712d commit 870ab9c
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions BeMyEyes/Source/Views/BMEPointsTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ - (void)awakeFromNib {
}

- (void)shouldLocalize {
[self updateTimeFormatLocale];
[self updateDateLabel];
[self updatePointsLabel];
}
Expand Down Expand Up @@ -69,26 +68,15 @@ - (TTTTimeIntervalFormatter *)timeFormatter
if (!_timeFormatter) {
_timeFormatter = [TTTTimeIntervalFormatter new];
_timeFormatter.usesIdiomaticDeicticExpressions = YES; // Allow 'yesterday' instead of '1 day ago'
[self updateTimeFormatLocale];
}
return _timeFormatter;
}


#pragma mark -

- (void)updateTimeFormatLocale {
NSString *languageCode = MKLocalizationPreferredLanguage();
NSString *localeIdentifier = [NSLocale currentLocale].localeIdentifier;
NSString *autoLocaleIdentifier = [NSLocale autoupdatingCurrentLocale].localeIdentifier;
// NSString *localeIdentifier = [NSString stringWithFormat:@"%@_%@", languageCode, regionCode];
NSLocale *locale = [NSLocale localeWithLocaleIdentifier:@"da_DK"];
self.timeFormatter.locale = locale;
NSLog(@"[[ %@ %@ %@ %@", localeIdentifier, autoLocaleIdentifier, locale, locale.localeIdentifier);
}
#pragma mark -

- (void)updateDateLabel {
self.dateLabel.text = [self.timeFormatter stringForTimeIntervalFromDate:[NSDate date] toDate:self.date];
self.dateLabel.text = _date ? [self.timeFormatter stringForTimeIntervalFromDate:[NSDate date] toDate:self.date] : nil;
}

- (void)updatePointsLabel {
Expand Down

0 comments on commit 870ab9c

Please sign in to comment.