diff --git a/BeMyEyes/Source/Views/BMEPointsTableViewCell.m b/BeMyEyes/Source/Views/BMEPointsTableViewCell.m index 88a23e2..ff36d9c 100644 --- a/BeMyEyes/Source/Views/BMEPointsTableViewCell.m +++ b/BeMyEyes/Source/Views/BMEPointsTableViewCell.m @@ -27,7 +27,6 @@ - (void)awakeFromNib { } - (void)shouldLocalize { - [self updateTimeFormatLocale]; [self updateDateLabel]; [self updatePointsLabel]; } @@ -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 {