Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Commit

Permalink
[#24811711] Fix that other flux capacitor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Dexter committed Feb 21, 2012
1 parent 8c19e3b commit 861862f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SSToolkit/NSDate+SSToolkitAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ - (NSString *)unitsGroupStringFromDate:(NSDate *)date {
unsigned int unitFlags = NSYearCalendarUnit|NSMonthCalendarUnit|NSWeekOfMonthCalendarUnit|NSDayCalendarUnit;
NSDateComponents *selfComps = [cal components:unitFlags fromDate:self];
NSDateComponents *dateComps = [cal components:unitFlags fromDate:date];
if ([self earlierDate:date] != self) {
result = NSLocalizedString(@"In The Future", @"In The Future");
} else if (dateComps.year - selfComps.year > 1) {
if (dateComps.year - selfComps.year > 1) {
result = NSLocalizedString(@"More Than One Year Ago", @"More Than One Year Ago");
} else if (dateComps.year - selfComps.year > 0) {
result = NSLocalizedString(@"Last Year", @"Last Year");
Expand All @@ -164,8 +162,10 @@ - (NSString *)unitsGroupStringFromDate:(NSDate *)date {
result = NSLocalizedString(@"This Week", @"This Week");
} else if (dateComps.day - selfComps.day > 0) {
result = NSLocalizedString(@"Yesterday", @"Yesterday");
} else {
} else if (dateComps.year == selfComps.year && dateComps.month == selfComps.month && dateComps.day == selfComps.day) {
result = NSLocalizedString(@"Today", @"Today");
} else {
result = NSLocalizedString(@"In The Future", @"In The Future");
}
return result;
}
Expand Down

0 comments on commit 861862f

Please sign in to comment.