From 12fb2d88857ace01b6c903bcd671b1f45e4f25e9 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sun, 24 Jul 2022 13:31:17 -0400 Subject: [PATCH] Indentation. --- Clocker/Events and Reminders/CalendarHandler.swift | 8 ++++---- Clocker/Panel/UI/TimezoneDataSource.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Clocker/Events and Reminders/CalendarHandler.swift b/Clocker/Events and Reminders/CalendarHandler.swift index b92abd6..4019ee4 100644 --- a/Clocker/Events and Reminders/CalendarHandler.swift +++ b/Clocker/Events and Reminders/CalendarHandler.swift @@ -124,7 +124,7 @@ extension EventCenter { let relevantEvents = filteredEvents[autoupdatingCalendar.startOfDay(for: Date())] ?? [] let filteredEvents = relevantEvents.filter { - $0.event.isAllDay == false && $0.event.endDate.timeIntervalSinceNow > 0 && $0.event.startDate.timeIntervalSinceNow > -300 + $0.event.isAllDay == false && $0.event.endDate.timeIntervalSinceNow > 0 && $0.event.startDate.timeIntervalSinceNow > -300 } if filteredEvents.count == 1 { return filteredEvents.first } @@ -458,16 +458,16 @@ struct EventInfo { var withoutAgo = withoutAn.replacingOccurrences(of: "ago", with: CLEmptyString) // If the user has not turned on seconds granularity for one of the timezones, // we return "in 12 seconds" which looks weird. - + let upToHours: Set = [.second, .minute, .hour] let difference = nsCalendar.dateComponents(upToHours, from: Date(), to: event.startDate as Date) let minuteDifference = difference.minute ?? 0 let hourDifference = difference.hour ?? 0 - + if hourDifference > 0, minuteDifference > 0 { withoutAgo.append(contentsOf: "\(minuteDifference)m") } - + return withoutAgo.contains("seconds") ? "in <1m" : "in \(withoutAgo.lowercased())".trimmingCharacters(in: .whitespaces) } else if event.startDate.isTomorrow { let hoursUntil = event.startDate.hoursUntil diff --git a/Clocker/Panel/UI/TimezoneDataSource.swift b/Clocker/Panel/UI/TimezoneDataSource.swift index f04c071..7eff348 100644 --- a/Clocker/Panel/UI/TimezoneDataSource.swift +++ b/Clocker/Panel/UI/TimezoneDataSource.swift @@ -220,7 +220,7 @@ extension TimezoneDataSource: PanelTableViewDelegate { if offSet == 0.0 { return "\(localizedName)" } else { - let offSetSign = offSet > 0 ? "+" : CLEmptyString + let offSetSign = offSet > 0 ? "+" : CLEmptyString let offsetString = "UTC\(offSetSign)\(offSet)" return "\(localizedName) (\(offsetString))" }