From f0e1e2f97967f814ec89822c5e04d1e8cb829dff Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 11 Dec 2024 10:07:09 +0100 Subject: [PATCH] [BUGFIX] Get correct year for weekConfig. Use ISO 8601 week-numbering year. --- Classes/Service/CalendarService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Service/CalendarService.php b/Classes/Service/CalendarService.php index 6beeb2a2a..9ce2e37bb 100644 --- a/Classes/Service/CalendarService.php +++ b/Classes/Service/CalendarService.php @@ -167,15 +167,15 @@ public function getWeekConfig(DateTime $firstDayOfCurrentWeek): array return [ 'previous' => [ 'weeknumber' => (int)$firstDayPreviousWeek->format('W'), - 'year' => (int)$firstDayPreviousWeek->format('Y'), + 'year' => (int)$firstDayPreviousWeek->format('o'), ], 'current' => [ 'weeknumber' => (int)$firstDayOfCurrentWeek->format('W'), - 'year' => (int)$firstDayOfCurrentWeek->format('Y'), + 'year' => (int)$firstDayOfCurrentWeek->format('o'), ], 'next' => [ 'weeknumber' => (int)$firstDayNextWeek->format('W'), - 'year' => (int)$firstDayNextWeek->format('Y'), + 'year' => (int)$firstDayNextWeek->format('o'), ], ]; }