From c4e4d9d04e0676511dff838dd696faad28ab9d92 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 24 Oct 2020 01:53:50 -0500 Subject: [PATCH] Don't use timezoneID, instead use timezone(). --- Clocker/Panel/Notes Popover/NotesPopover.swift | 4 ++-- Clocker/Preferences/General/PreferencesDataSource.swift | 2 +- Clocker/Preferences/General/PreferencesViewController.swift | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Clocker/Panel/Notes Popover/NotesPopover.swift b/Clocker/Panel/Notes Popover/NotesPopover.swift index 4ba1af1..1fad105 100644 --- a/Clocker/Panel/Notes Popover/NotesPopover.swift +++ b/Clocker/Panel/Notes Popover/NotesPopover.swift @@ -150,7 +150,7 @@ class NotesPopover: NSViewController { } private func getCurrentTimezoneDate(completionHandler: @escaping (_ response: Date?) -> Void) { - guard let timezoneID = dataObject?.timezoneID else { + guard let timezoneID = dataObject?.timezone() else { assertionFailure("Unable to retrieve timezoneID from the model") completionHandler(nil) return @@ -353,7 +353,7 @@ class NotesPopover: NSViewController { let alertIndex = alertPopupButton.indexOfSelectedItem if eventCenter.createReminder(with: model.customLabel!, - timezone: model.timezoneID!, + timezone: model.timezone(), alertIndex: alertIndex, reminderDate: reminderPicker.dateValue, additionalNotes: model.note) { diff --git a/Clocker/Preferences/General/PreferencesDataSource.swift b/Clocker/Preferences/General/PreferencesDataSource.swift index 97823cd..4b9978a 100644 --- a/Clocker/Preferences/General/PreferencesDataSource.swift +++ b/Clocker/Preferences/General/PreferencesDataSource.swift @@ -130,7 +130,7 @@ extension PreferencesDataSource: NSTableViewDataSource { return model.formattedAddress } - return model.timezoneID + return model.timezone() } func tableView(_: NSTableView, setObjectValue object: Any?, for _: NSTableColumn?, row: Int) { diff --git a/Clocker/Preferences/General/PreferencesViewController.swift b/Clocker/Preferences/General/PreferencesViewController.swift index 3cfff31..7dc6fea 100644 --- a/Clocker/Preferences/General/PreferencesViewController.swift +++ b/Clocker/Preferences/General/PreferencesViewController.swift @@ -633,7 +633,7 @@ extension PreferencesViewController { // Mark if the timezone is same as local timezone let timezoneObject = TimezoneData(with: newTimeZone) - timezoneObject.isSystemTimezone = timezoneObject.timezoneID == NSTimeZone.system.identifier + timezoneObject.isSystemTimezone = timezoneObject.timezone() == NSTimeZone.system.identifier let operationsObject = TimezoneDataOperations(with: timezoneObject) operationsObject.saveObject() @@ -950,8 +950,8 @@ extension PreferencesViewController { return false } - let timezone1 = NSTimeZone(name: object1.timezoneID!) - let timezone2 = NSTimeZone(name: object2.timezoneID!) + let timezone1 = NSTimeZone(name: object1.timezone()) + let timezone2 = NSTimeZone(name: object2.timezone()) let difference1 = system.secondsFromGMT() - timezone1!.secondsFromGMT let difference2 = system.secondsFromGMT() - timezone2!.secondsFromGMT