Today marker and default planning horizon disagree near midnight outside Europe/Paris #301

Open
opened 2026-10-18 01:48:19 +02:00 by nessar · 0 comments
Owner

Problem

CalendarService.getDefaultPlanningHorizon() starts the horizon on the Paris date (planningDateInParis(now), src/app/services/calendar-service.ts:69-71), but project() marks the TODAY day from dateCache.getTodayComponents() (calendar-service.ts:88-92, 126-130), which uses the runtime's local date.

Whenever the local date differs from the Paris date, the horizon's first day is not marked as today, and a different day (or none) gets the today marker. This happens:

  • in CI containers (UTC), every night between 22:00 and 24:00 UTC during CEST (23:00-24:00 during CET);
  • for any user whose browser is not on Europe/Paris time, around their midnight.

Evidence

CI for PR #296 (run 98, job test) ran at 2026-10-17 22:16 UTC (Sunday 00:16 Paris) and failed with 1 of 750 tests:

(fail) CalendarService > project > projects weekends, holidays and today for the default planning horizon
Expected to contain: "today"
Received: "weekend"

The horizon started on Sunday 2026-10-18 (Paris) while the container's local today was still Saturday 2026-10-17. The failure is unrelated to that PR's change and reproduces on develop in that time window.

Expected

The today marker and the default horizon use the same planning-day definition (presumably the Paris date via planning-date.ts), and the test is deterministic regardless of the clock and time zone (inject now/fake the clock rather than relying on wall time).

Repro

Run TZ=UTC bun run test with the system clock between 22:00 and 24:00 UTC (CEST), or fake Date to e.g. 2026-10-17T22:16:00Z.

## Problem `CalendarService.getDefaultPlanningHorizon()` starts the horizon on the **Paris** date (`planningDateInParis(now)`, `src/app/services/calendar-service.ts:69-71`), but `project()` marks the TODAY day from `dateCache.getTodayComponents()` (`calendar-service.ts:88-92`, `126-130`), which uses the **runtime's local** date. Whenever the local date differs from the Paris date, the horizon's first day is not marked as today, and a different day (or none) gets the today marker. This happens: - in CI containers (UTC), every night between 22:00 and 24:00 UTC during CEST (23:00-24:00 during CET); - for any user whose browser is not on Europe/Paris time, around their midnight. ## Evidence CI for PR #296 (run 98, job `test`) ran at 2026-10-17 22:16 UTC (Sunday 00:16 Paris) and failed with 1 of 750 tests: ``` (fail) CalendarService > project > projects weekends, holidays and today for the default planning horizon Expected to contain: "today" Received: "weekend" ``` The horizon started on Sunday 2026-10-18 (Paris) while the container's local today was still Saturday 2026-10-17. The failure is unrelated to that PR's change and reproduces on `develop` in that time window. ## Expected The today marker and the default horizon use the same planning-day definition (presumably the Paris date via `planning-date.ts`), and the test is deterministic regardless of the clock and time zone (inject `now`/fake the clock rather than relying on wall time). ## Repro Run `TZ=UTC bun run test` with the system clock between 22:00 and 24:00 UTC (CEST), or fake `Date` to e.g. 2026-10-17T22:16:00Z.
nessar added the needs-triage label 2026-10-18 01:48:19 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#301