Browse Source

Relative day calculation error.

v1.4.1
Abhishek Banthia 8 years ago
parent
commit
e56dce068c
  1. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  2. 3
      Clocker/Model/CLTimezoneDataOperations.m

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

3
Clocker/Model/CLTimezoneDataOperations.m

@ -151,6 +151,7 @@
NSCalendar *calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; NSCalendar *calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];
NSInteger timezoneWeekday = [calendar component:NSCalendarUnitWeekday fromDate:convertedDate]; NSInteger timezoneWeekday = [calendar component:NSCalendarUnitWeekday fromDate:convertedDate];
timezoneWeekday = timezoneWeekday % 7;
NSNumber *relativeDayPreference = [[NSUserDefaults standardUserDefaults] objectForKey:CLRelativeDateKey]; NSNumber *relativeDayPreference = [[NSUserDefaults standardUserDefaults] objectForKey:CLRelativeDateKey];
@ -167,6 +168,8 @@
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
NSInteger weekday = [calendar component:NSCalendarUnitWeekday fromDate:localDate]; NSInteger weekday = [calendar component:NSCalendarUnitWeekday fromDate:localDate];
weekday = weekday % 7;
if (weekday == timezoneWeekday + 1) if (weekday == timezoneWeekday + 1)
{ {
NSString *totalRelative = [NSString stringWithFormat:@"Yesterday%@", [self getTimeDifference]]; NSString *totalRelative = [NSString stringWithFormat:@"Yesterday%@", [self getTimeDifference]];

Loading…
Cancel
Save