- Issue created by @se7ent1
- π¨πSwitzerland handkerchief
Same problem here.
Core: 10.3.10
calendar_view: 2.1.x-dev updated 18 Aug 2024 at 19:46 UTC- calendar_view_w52-2024.png β : This week is correct, there are no events and all the dates are correct.
- calendar_view_w01-2025.png β : This week is wrong, events should be visble in this week and the dates (month, year, days) are wrong.
- calendar_view_w02-2025.png β : This week is correct again, events are visble and the dates (month, year, days) are also correct.
- π§πͺBelgium ttnt
I see the same. I have a week view in my case and it just has:
Week 01 - December 2024
The dates that are mentioned are: 1/01/2024 to 7/01/2024.
ISO Week 01 2025: December 30, 2024-January 5, 2025.
So it probably takes the first week of the year, which in this case is the first week of 2024 as the Monday is in 2024. - π«π·France pcharrat La rue, la vraie.
Hello,
I see that there's a problem with navigation to the first week of 2025, because I get the following case:
Week 01 - 2024 (1,2,3,4,5,6) which is the first week of 2024.
After analysis, the problem comes from a borderline case of code:public function buildCalendars(int $selected_timestamp): array { $year = date('Y', $selected_timestamp); $week = date('W', $selected_timestamp); // dd($selected_timestamp, $year, $week); $calendars[$year . W' . $week] = $this->buildTable($year, $week); return $calendars; }
Indeed, when we enter the selected_timestamp 1735599600 (31/12/2024 00:00:00)
we see the following values: Year = 2024 & Week = 01, i.e. the first week of 2024.
After some research, it seems that this error is caused by a borderline case of format(βWβ) (found here: https://bugs.php.net/bug.php?id=65730).
To avoid this problem, change the :
$year = date('Y', $selected_timestamp);
with option'o'
or the doc says:ISO 8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.
- π«π·France pcharrat La rue, la vraie.
There is still a problem with the view title. It says: 'Week 01 - december 2024'
Because the default title is:
[date:custom:\W\e\e\k W - F y]
If you want the right year, you can change it to'o'
like:
[date:custom:\W\e\e\k W - F o]
In the configurations and code. However, the month is wrong, so we get :
Week 01 - december 2025
It remains to be seen how this particular case can be managed.