From de044b336038f4b47be9431c48a3253cb3a692bc Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 28 Jun 2022 15:45:44 -0400 Subject: [PATCH] Exclude events past their 5 minutes mark. --- Clocker/Events and Reminders/CalendarHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Clocker/Events and Reminders/CalendarHandler.swift b/Clocker/Events and Reminders/CalendarHandler.swift index 6d11243..b92abd6 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.isAllDay == false && $0.event.endDate.timeIntervalSinceNow > 0 && $0.event.startDate.timeIntervalSinceNow > -300 } if filteredEvents.count == 1 { return filteredEvents.first }