fix(journal): widen events window to match prep's framing
The right rail's loadEvents was using "now → now + 14 days", which filtered out events earlier today that had already passed. The prep uses "today 00:00 → today 23:59" so it includes those events and explicitly notes they're "in the past". The two surfaces talked about different sets of events. Widen the right rail to "today 00:00 → today + 14 days 23:59" so events from earlier today still surface and group under "Today". The prep and the right rail now reference the same set within today. Events further out (next 14 days) keep working as before. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -130,10 +130,15 @@ function formatEventTime(ev: EventEntry): string {
|
||||
|
||||
async function loadEvents() {
|
||||
try {
|
||||
const now = new Date()
|
||||
const end = new Date(now)
|
||||
// Window: today 00:00 → 14 days out. Matches the prep's framing — events
|
||||
// earlier today (already past) still surface here, grouped under "Today",
|
||||
// so the right rail aligns with what the prep references.
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
const end = new Date(start)
|
||||
end.setDate(end.getDate() + 14)
|
||||
upcomingEvents.value = await listEvents(now.toISOString(), end.toISOString())
|
||||
end.setHours(23, 59, 59, 999)
|
||||
upcomingEvents.value = await listEvents(start.toISOString(), end.toISOString())
|
||||
} catch { /* silent */ }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user