Browse Source

Handle edge case.

pull/113/head
Abhishek 3 years ago
parent
commit
9fadf7b7a3
  1. 9
      Clocker/Panel/ParentPanelController.swift

9
Clocker/Panel/ParentPanelController.swift

@ -1053,12 +1053,21 @@ extension ParentPanelController: NSSharingServicePickerDelegate {
return newProposedServices return newProposedServices
} }
/// Retrieves all the times from user's added timezones. Times are sorted by date. For eg:
/// Feb 5
/// California - 17:17:01
/// Feb 6
/// London - 01:17:01
private func retrieveAllTimes() -> String { private func retrieveAllTimes() -> String {
var clipboardCopy = String() var clipboardCopy = String()
// Get all timezones // Get all timezones
let timezones = DataStore.shared().timezones() let timezones = DataStore.shared().timezones()
if timezones.isEmpty {
return clipboardCopy
}
// Sort them in ascending order // Sort them in ascending order
let sortedByTime = timezones.sorted { obj1, obj2 -> Bool in let sortedByTime = timezones.sorted { obj1, obj2 -> Bool in
let system = NSTimeZone.system let system = NSTimeZone.system

Loading…
Cancel
Save