Weekly view doesn't show first week of new year 2025

Created on 29 October 2024, 8 months ago

Problem/Motivation

After creating a content type β€œCalendar” and entering all dates (via a feed), both the monthly calendar and weekly calendar are correctly formatted by Views.
Only for the last two days of December and the beginning of the new year 2025, the data in the weekly calendar are not displayed (in the monthly calendar, on the other hand, they are).
I tried with:
- emptying the cache
- delete and recreate the relevant content
- deleting the last two days of December to get only the days from January 01 in view
Each time I get a blank display for this week.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium se7ent1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 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

  • πŸ‡ͺπŸ‡ΈSpain jmagtibay

    We are having this same problem.

  • πŸ‡§πŸ‡ͺ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.

  • πŸ‡¨πŸ‡­Switzerland handkerchief

    Any news on that?

  • πŸ‡«πŸ‡·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.

Production build 0.71.5 2024