Problem
firstActiveAt and lastActiveAt store only HH:mm strings. If the Mac stays on overnight or resumes from sleep the next day, the displayed range (e.g. 22:45 - 09:30) is ambiguous — there's no date context to tell the user these times span two different days.
Proposed Solution
-
EventMonitor.swift — change the time formatter from HH:mm to a full datetime format (e.g. yyyy-MM-dd'T'HH:mm) so the date is embedded in the stored value.
-
MenuBarViewModel.swift — add a formattedActiveTimeRange computed property with smart formatting:
- Same day as today →
HH:mm - HH:mm (existing look, no change)
- Spans two different dates →
MMM d, HH:mm - MMM d, HH:mm (e.g. Mar 29, 22:45 - Mar 30, 09:30)
- Graceful fallback for legacy
HH:mm values already in the database
-
MenuBarView.swift — use the new formatted property.
Notes
- No DB migration needed —
first_active_at / last_active_at columns are plain text; the wider format is backwards-compatible.
- Legacy
HH:mm values already stored will render as-is via fallback parsing.
Problem
firstActiveAtandlastActiveAtstore onlyHH:mmstrings. If the Mac stays on overnight or resumes from sleep the next day, the displayed range (e.g.22:45 - 09:30) is ambiguous — there's no date context to tell the user these times span two different days.Proposed Solution
EventMonitor.swift— change the time formatter fromHH:mmto a full datetime format (e.g.yyyy-MM-dd'T'HH:mm) so the date is embedded in the stored value.MenuBarViewModel.swift— add aformattedActiveTimeRangecomputed property with smart formatting:HH:mm - HH:mm(existing look, no change)MMM d, HH:mm - MMM d, HH:mm(e.g.Mar 29, 22:45 - Mar 30, 09:30)HH:mmvalues already in the databaseMenuBarView.swift— use the new formatted property.Notes
first_active_at/last_active_atcolumns are plain text; the wider format is backwards-compatible.HH:mmvalues already stored will render as-is via fallback parsing.