Browse Source

Indentation.

pull/113/head
Abhishek 2 years ago
parent
commit
12fb2d8885
  1. 8
      Clocker/Events and Reminders/CalendarHandler.swift
  2. 2
      Clocker/Panel/UI/TimezoneDataSource.swift

8
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<Calendar.Component> = [.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

2
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))"
}

Loading…
Cancel
Save