diff --git a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate index afaeef3..1d438d6 100644 Binary files a/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate and b/Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index cbae4e0..3172ea7 100644 --- a/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Clocker.xcodeproj/xcuserdata/abhishekbanthia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -13,21 +13,5 @@ stopOnStyle = "0"> - - - - diff --git a/Clocker/Model/CLTimezoneDataOperations.m b/Clocker/Model/CLTimezoneDataOperations.m index 57deb82..f966696 100644 --- a/Clocker/Model/CLTimezoneDataOperations.m +++ b/Clocker/Model/CLTimezoneDataOperations.m @@ -126,64 +126,6 @@ return menuTitle; } -- (NSString *)compareSystemDate:(NSString *)systemDate toTimezoneDate:(NSString *)date -{ - NSDateFormatter *localFormatter = [NSDateFormatter new]; - localFormatter.timeStyle = NSDateFormatterMediumStyle; - localFormatter.dateStyle = NSDateFormatterMediumStyle; - localFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; - - NSDate *localDate = [localFormatter dateFromString:systemDate]; - NSDate *timezoneDate = [localFormatter dateFromString:date]; - - // Specify which units we would like to use - NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - NSInteger weekday = [calendar component:NSCalendarUnitWeekday fromDate:localDate]; - - NSInteger timezoneWeekday = [calendar component:NSCalendarUnitWeekday fromDate:timezoneDate]; - - if ([self.dataObject.nextUpdate isKindOfClass:[NSString class]]) - { - - NSUInteger units = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; - NSDateComponents *comps = [[NSCalendar currentCalendar] components:units fromDate:timezoneDate]; - comps.day = comps.day + 1; - NSDate *tomorrowMidnight = [[NSCalendar currentCalendar] dateFromComponents:comps]; - - NSDictionary *dictionary = @{CLTimezoneID : self.dataObject.timezoneID, @"latitude" : self.dataObject.latitude, - @"longitude" : self.dataObject.longitude, CLCustomLabel : self.dataObject.customLabel, - CLPlaceIdentifier : self.dataObject.place_id, CLTimezoneName : self.dataObject.formattedAddress}; - - - CLTimezoneData *newDataObject = [[CLTimezoneData alloc] initWithDictionary:dictionary]; - [newDataObject setNextUpdateForSunriseSet:tomorrowMidnight]; - - PanelController *panelController = [PanelController getPanelControllerInstance]; - - (panelController.defaultPreferences)[[panelController.defaultPreferences indexOfObject:self]] = newDataObject; - - [[NSUserDefaults standardUserDefaults] setObject:panelController.defaultPreferences forKey:CLDefaultPreferenceKey]; - } - - NSInteger daysApart = [timezoneDate daysFrom:localDate]; - - if (daysApart == 0) { - return @"Today"; - } - else if (daysApart == -1) - { - return @"Yesterday"; - } - else if (daysApart == 1) - { - return @"Tomorrow"; - } - else - { - return [self getWeekdayFromInteger:weekday+2]; - } -} - - (NSString *)getDateForTimeZoneWithFutureSliderValue:(NSInteger)futureSliderValue andDisplayType:(CLDateDisplayType)type {