diff --git a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift index c6b27fb..94cb558 100644 --- a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift +++ b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift @@ -26,19 +26,21 @@ extension TimezoneDataOperations { assertionFailure("Data was unexpectedly nil") return CLEmptyString } - - let dateFormatter = DateFormatterManager.dateFormatterWithFormat(with: .none, - format: dataObject.timezoneFormat(DataStore.shared().timezoneFormat()), - timezoneIdentifier: dataObject.timezone(), - locale: Locale.autoupdatingCurrent) if (dataObject.timezoneFormat(DataStore.shared().timezoneFormat()) == DateFormat.epochTime) { + print("Slider Value is \(sliderValue)") let timezone = TimeZone(identifier: dataObject.timezone()) let offset = timezone?.secondsFromGMT(for: newDate) ?? 0 let value = Int(Date().timeIntervalSince1970 + Double(offset)) return "\(value)" } + let dateFormatter = DateFormatterManager.dateFormatterWithFormat(with: .none, + format: dataObject.timezoneFormat(DataStore.shared().timezoneFormat()), + timezoneIdentifier: dataObject.timezone(), + locale: Locale.autoupdatingCurrent) + + return dateFormatter.string(from: newDate) }