Browse Source

Return EventInfo instead of EKEvent.

pull/101/head
Abhishek 4 years ago
parent
commit
fa71c58ff4
  1. 6
      Clocker/Events and Reminders/CalendarHandler.swift
  2. 8
      Clocker/Panel/ParentPanelController.swift

6
Clocker/Events and Reminders/CalendarHandler.swift

@ -150,7 +150,7 @@ extension EventCenter {
return menubarText
}
func nextOccuring(_: [EventInfo]) -> EKEvent? {
func nextOccuring(_: [EventInfo]) -> EventInfo? {
if calendarAccessDenied() || calendarAccessNotDetermined() {
return nil
}
@ -162,14 +162,14 @@ extension EventCenter {
}.first
if let firstEvent = filteredEvent {
return firstEvent.event
return firstEvent
}
let filteredAllDayEvent = relevantEvents.filter {
$0.isAllDay
}.first
return filteredAllDayEvent?.event
return filteredAllDayEvent
}
func initializeStoreIfNeccesary() {

8
Clocker/Panel/ParentPanelController.swift

@ -810,9 +810,9 @@ class ParentPanelController: NSWindowController {
return
}
self.calendarColorView.layer?.backgroundColor = upcomingEvent.calendar.color.cgColor
self.nextEventLabel.stringValue = upcomingEvent.title
self.nextEventLabel.toolTip = upcomingEvent.title
self.calendarColorView.layer?.backgroundColor = upcomingEvent.event.calendar.color.cgColor
self.nextEventLabel.stringValue = upcomingEvent.event.title
self.nextEventLabel.toolTip = upcomingEvent.event.title
if upcomingEvent.isAllDay == true {
let title = events.count == 1 ? "All-Day" : "All Day - Total \(events.count) events today"
self.setCalendarButtonTitle(buttonTitle: title)
@ -822,7 +822,7 @@ class ParentPanelController: NSWindowController {
return
}
let timeSince = Date().timeAgo(since: upcomingEvent.startDate)
let timeSince = Date().timeAgo(since: upcomingEvent.event.startDate)
let withoutAn = timeSince.replacingOccurrences(of: "an", with: CLEmptyString)
let withoutAgo = withoutAn.replacingOccurrences(of: "ago", with: CLEmptyString)

Loading…
Cancel
Save