fix(calendar): mark today on the Europe/Paris date

The calendar highlighted today from the browser's local date while the
default planning horizon starts on the Europe/Paris date, so the two
disagreed for a few hours a day (and always, for users in another time
zone). The horizon's first day was then not marked as today. This also
failed the CI test run in UTC containers between 22:00 and 24:00 UTC.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Sonnet 5.5 committed 2026-10-19 09:52:03 +02:00
1 parent 7fc3457b63
commit f458a83599
1 file changed
+4 -6
+4 -6
View File
@@ -85,11 +85,9 @@ export class CalendarService {
const holidays = new Set(
this.getHolidays(first.getFullYear(), last.getFullYear()).map((h) => h.getTime()),
);
const {
date: todayDate,
month: todayMonth,
year: todayYear,
} = this.dateCache.getTodayComponents();
const [todayYear, todayMonth, todayDate] = planningDateInParis(new Date())
.split('-')
.map(Number);
const months: CalendarProjection['months'] = [];
const ranges: SelectedDate[] = [];
const cursor = new Date(first);
@@ -124,7 +122,7 @@ export class CalendarService {
);
if (
day.getDate() === todayDate &&
day.getMonth() === todayMonth &&
day.getMonth() + 1 === todayMonth &&
day.getFullYear() === todayYear
)
ranges.push(new SelectedDate(DayType.TODAY, new DateRange<Date>(day, day)));