Browse Source

Don't use timezoneID, instead use timezone().

pull/92/head
Abhishek 4 years ago
parent
commit
c4e4d9d04e
  1. 4
      Clocker/Panel/Notes Popover/NotesPopover.swift
  2. 2
      Clocker/Preferences/General/PreferencesDataSource.swift
  3. 6
      Clocker/Preferences/General/PreferencesViewController.swift

4
Clocker/Panel/Notes Popover/NotesPopover.swift

@ -150,7 +150,7 @@ class NotesPopover: NSViewController {
} }
private func getCurrentTimezoneDate(completionHandler: @escaping (_ response: Date?) -> Void) { 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") assertionFailure("Unable to retrieve timezoneID from the model")
completionHandler(nil) completionHandler(nil)
return return
@ -353,7 +353,7 @@ class NotesPopover: NSViewController {
let alertIndex = alertPopupButton.indexOfSelectedItem let alertIndex = alertPopupButton.indexOfSelectedItem
if eventCenter.createReminder(with: model.customLabel!, if eventCenter.createReminder(with: model.customLabel!,
timezone: model.timezoneID!, timezone: model.timezone(),
alertIndex: alertIndex, alertIndex: alertIndex,
reminderDate: reminderPicker.dateValue, reminderDate: reminderPicker.dateValue,
additionalNotes: model.note) { additionalNotes: model.note) {

2
Clocker/Preferences/General/PreferencesDataSource.swift

@ -130,7 +130,7 @@ extension PreferencesDataSource: NSTableViewDataSource {
return model.formattedAddress return model.formattedAddress
} }
return model.timezoneID return model.timezone()
} }
func tableView(_: NSTableView, setObjectValue object: Any?, for _: NSTableColumn?, row: Int) { func tableView(_: NSTableView, setObjectValue object: Any?, for _: NSTableColumn?, row: Int) {

6
Clocker/Preferences/General/PreferencesViewController.swift

@ -633,7 +633,7 @@ extension PreferencesViewController {
// Mark if the timezone is same as local timezone // Mark if the timezone is same as local timezone
let timezoneObject = TimezoneData(with: newTimeZone) let timezoneObject = TimezoneData(with: newTimeZone)
timezoneObject.isSystemTimezone = timezoneObject.timezoneID == NSTimeZone.system.identifier timezoneObject.isSystemTimezone = timezoneObject.timezone() == NSTimeZone.system.identifier
let operationsObject = TimezoneDataOperations(with: timezoneObject) let operationsObject = TimezoneDataOperations(with: timezoneObject)
operationsObject.saveObject() operationsObject.saveObject()
@ -950,8 +950,8 @@ extension PreferencesViewController {
return false return false
} }
let timezone1 = NSTimeZone(name: object1.timezoneID!) let timezone1 = NSTimeZone(name: object1.timezone())
let timezone2 = NSTimeZone(name: object2.timezoneID!) let timezone2 = NSTimeZone(name: object2.timezone())
let difference1 = system.secondsFromGMT() - timezone1!.secondsFromGMT let difference1 = system.secondsFromGMT() - timezone1!.secondsFromGMT
let difference2 = system.secondsFromGMT() - timezone2!.secondsFromGMT let difference2 = system.secondsFromGMT() - timezone2!.secondsFromGMT

Loading…
Cancel
Save