Browse Source

Update TimezoneData.swift

pull/92/head
Abhishek 4 years ago
parent
commit
fcc4f95a4c
  1. 62
      Clocker/Panel/Data Layer/TimezoneData.swift

62
Clocker/Panel/Data Layer/TimezoneData.swift

@ -329,9 +329,21 @@ class TimezoneData: NSObject, NSCoding {
if shouldOverride == 0 { if shouldOverride == 0 {
overrideFormat = .globalFormat overrideFormat = .globalFormat
} else if shouldOverride == 1 { } else if shouldOverride == 1 {
overrideFormat = .twelveHourFormat
} else if shouldOverride == 2 {
overrideFormat = .twentyFourFormat overrideFormat = .twentyFourFormat
} else { } else if shouldOverride == 4 {
overrideFormat = .globalFormat overrideFormat = .twelveHourWithSeconds
} else if shouldOverride == 5 {
overrideFormat = .twentyHourWithSeconds
} else if shouldOverride == 7 {
overrideFormat = .twelveHourPrecedingZero
} else if shouldOverride == 8 {
overrideFormat = .twelveHourPrecedingZeroSeconds
} else if shouldOverride == 10 {
overrideFormat = .twelveHourWithoutSuffix
} else if shouldOverride == 11 {
overrideFormat = .twelveHourWithoutSuffixAndSeconds
} }
} }
@ -361,29 +373,29 @@ class TimezoneData: NSObject, NSCoding {
func timezoneFormat() -> String { func timezoneFormat() -> String {
let chosenDefault = DataStore.shared().timezoneFormat() let chosenDefault = DataStore.shared().timezoneFormat()
return TimezoneData.values[chosenDefault] ?? DateFormat.twelveHour let timeFormat = TimezoneData.values[chosenDefault] ?? DateFormat.twelveHour
// var timeFormat = DateFormat.twentyFourHour if overrideFormat == .globalFormat {
// return timeFormat
// if shouldShowSeconds() { } else if overrideFormat == .twelveHourFormat {
// if overrideFormat == .globalFormat { return DateFormat.twelveHour
// timeFormat = true ? DateFormat.twelveHourWithSeconds : DateFormat.twentyFourHourWithSeconds } else if overrideFormat == .twentyFourFormat {
// } else if overrideFormat == .twelveHourFormat { return DateFormat.twentyFourHour
// timeFormat = DateFormat.twelveHourWithSeconds } else if overrideFormat == .twelveHourWithSeconds {
// } else { return DateFormat.twelveHourWithSeconds
// timeFormat = DateFormat.twentyFourHourWithSeconds } else if overrideFormat == .twentyHourWithSeconds {
// } return DateFormat.twentyFourHourWithSeconds
// } else { } else if overrideFormat == .twelveHourPrecedingZero {
// if overrideFormat == .globalFormat { return DateFormat.twelveHourWithZero
// timeFormat = true ? DateFormat.twelveHour : DateFormat.twentyFourHour } else if overrideFormat == .twelveHourPrecedingZeroSeconds {
// } else if overrideFormat == .twelveHourFormat { return DateFormat.twelveHourWithZeroSeconds
// timeFormat = DateFormat.twelveHour } else if overrideFormat == .twelveHourWithoutSuffix {
// } else { return DateFormat.twelveHourWithoutSuffix
// timeFormat = DateFormat.twentyFourHour } else if overrideFormat == .twelveHourWithoutSuffixAndSeconds {
// } return DateFormat.twelveHourWithoutSuffixAndSeconds
// } }
//
// return timeFormat return timeFormat
} }
func shouldShowSeconds() -> Bool { func shouldShowSeconds() -> Bool {

Loading…
Cancel
Save