On the 31st the number of the next month is calculated incorrectly

Created on 6 April 2025, 18 days ago

Please note, this issue is not duplicate for https://www.drupal.org/project/date_pager/issues/3517131 πŸ› Date is considered after noon (12:00), but it should be after midnight (after 00:00) Active

Problem/Motivation

On the 31st the number of the next month is calculated incorrectly

Steps to reproduce

There are 2 events on the site with dates in 2025:
1: March 28th (or any day of Marth)
2: April 4th (or any day of April)

Pager options
Default time: current
Granularity: Month (or Day)

The time is not specified in the date field. Only the day.

If today is March 30th, the pager is displayed correctly.
When Granularity: Month is specified, the pager is displayed like this:

When Granularity: Day is specified, the pager is displayed like this:

If today is March 31st, the pager is displayed incorrectly.

In the following screenshots, the month is specified as "05". Although April should be displayed as "04".

When Granularity: Month is specified, the pager is displayed like this:

When Granularity: Day is specified, the pager is displayed like this:

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine vasyok

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

Comments & Activities

  • Issue created by @vasyok
  • πŸ‡©πŸ‡ͺGermany sleitner

    I think this is also UTC / local time zone related

  • πŸ‡ΊπŸ‡¦Ukraine vasyok
  • πŸ‡ΊπŸ‡¦Ukraine vasyok

    I don't think that its timezone problem. I change topic. Now in pager 3 dates. If today is March 31st, then 5th month displayed twice.

  • πŸ‡©πŸ‡ͺGermany sleitner

    Could you reproduce this on a new Drupal installation, e.g. on simplytest.me ? Do you patch something in date_pager? Or Javascript changing content in frontend? What is the URL in the false 05 link?
    I couldn't reproduce it with the steps given above on simplytest.me.

  • πŸ‡ΊπŸ‡¦Ukraine vasyok

    Can simplytest.me choose "current" date?
    No, i don't patch date_pager.
    Same trouble in Claro or Olivero theme. Screenshot:

    Both 05 links linked to May i.e. /view-url?date=2025-05.
    On March 31st it's also possible to come in to April i.e. to /view-url?date=2025-04, but this 04 link is missing in pager.

  • πŸ‡©πŸ‡ͺGermany sleitner

    I could reproduce it locally. It was a problem on top of the timezone problem with the mapping of the current date to the dates in the pager. Please test and review πŸ› Paging seems to be done using UTC and not local time zone. Active

Production build 0.71.5 2024