- Issue created by @vasyok
- π©πͺGermany sleitner
I think this is also UTC / local time zone related
- πΊπ¦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
- Status changed to Closed: duplicate
19 days ago 12:21pm 14 June 2025 - πΊπ¦Ukraine vasyok
Installed the latest version 2.1.1-beta1 . The problem is still there.
- π©πͺGermany sleitner
@vasyok : I cannot reproduce this issue, if I set the time manually to 31.3.2025. Which system timezone and user timezone are you using? Which field type is your date field?
- πΊπ¦Ukraine vasyok
I don't know why, but the results now are different from the results of my last answer. Sorry if I messed something up.
List of events is the same as before:
View is also the same:
System timezone and user timezone
/admin/config/regional/settings
Default country: Germany (If I switch it to "Ukraine" nothing changes)
Default time zone: UTC
Users may set their own time zone OFFI wrote a function that defines 3 variables
- site_time
- site_timezone
- server_time
MYTHEME.libraries.yml
function MYTHEME_preprocess_views_view(array &$variables) { $date = new \DateTime('now', new \DateTimeZone(\Drupal::config('system.date')->get('timezone.default'))); $variables['site_time'] = $date->format('Y-m-d H:i:s'); $variables['site_timezone'] = $date->getTimezone()->getName(); $server_time = new \DateTime(); $variables['server_time'] = $server_time->format('Y-m-d H:i:s'); }
... and displayed these variables in the view page
views-view--MYVIEW--page-3.html.twig
Current site time: {{ site_time }} Site time zone: {{ site_timezone }} Server time: {{ server_time }}
Results
2.1.1-alpha2 without patches
If today is March 30th, the pager on /test-page is displayed correctly:
If today is March 31st, MaΠ½ is displayed twice:
2.1.1-beta1
If today is March 30th or 31st - May is not displayed:
- π©πͺGermany sleitner
Users may set their own time zone OFF
does not mean that the website timezone is used, the users simply cannot change the settings via UI. I assume there was a different timezone set. Now the user time zone defaults to website timezone if user timezone is not configurable. Please review MR