diff --git a/Clocker/Overall App/AppDefaults.swift b/Clocker/Overall App/AppDefaults.swift index 86b52cb..a98c096 100644 --- a/Clocker/Overall App/AppDefaults.swift +++ b/Clocker/Overall App/AppDefaults.swift @@ -127,7 +127,8 @@ class AppDefaults { CLTruncateTextLength: 30, CLSelectedCalendars: [], CLAppDisplayOptions: 1, - CLMenubarCompactMode: 1] + CLMenubarCompactMode: 1, + CLDisplayDSTTransitionInfo: 0] } } diff --git a/Clocker/Overall App/DataStore.swift b/Clocker/Overall App/DataStore.swift index 3e18a7c..3fad483 100644 --- a/Clocker/Overall App/DataStore.swift +++ b/Clocker/Overall App/DataStore.swift @@ -16,6 +16,7 @@ enum ViewType { case placeInMenubar case dayInMenubar case menubarCompactMode + case dstTransitionInfo } class DataStore: NSObject { @@ -138,6 +139,8 @@ class DataStore: NSObject { return shouldDisplayHelper(CLShowDayInMenu) case .appDisplayOptions: return shouldDisplayHelper(CLAppDisplayOptions) + case .dstTransitionInfo: + return shouldDisplayHelper(CLDisplayDSTTransitionInfo) case .menubarCompactMode: guard let value = retrieve(key: CLMenubarCompactMode) as? Int else { return false diff --git a/Clocker/Overall App/Strings.swift b/Clocker/Overall App/Strings.swift index 3faaf11..aa2305b 100644 --- a/Clocker/Overall App/Strings.swift +++ b/Clocker/Overall App/Strings.swift @@ -37,3 +37,4 @@ let CLDefaultMenubarMode = "com.abhishek.shouldDefaultToCompactMode" let CLInstallHomeIndicatorObject = "installHomeIndicatorObject" let CLDefaultThemeOnMojave = "com.abhishek.defaultHasBeenSetOnMacOsMojave" let CLSwitchToCompactModeAlert = "com.abhishek.switchToCompactMode" +let CLDisplayDSTTransitionInfo = "com.abhishek.showDSTTransitionInfo" diff --git a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift index aa3fe05..bc61bee 100644 --- a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift +++ b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift @@ -34,6 +34,10 @@ extension TimezoneDataOperations { } func nextDaylightSavingsTransitionIfAvailable(with sliderValue: Int) -> String? { + if DataStore.shared().shouldDisplay(.dstTransitionInfo) == false { + return nil + } + let currentTimezone = TimeZone(identifier: dataObject.timezone()) guard let nextDaylightSavingsTransition = currentTimezone?.nextDaylightSavingTimeTransition else { return nil