sap.m.DatePicker show wrong date when switch timezone
OpenUI5 version: 1.120.1 Browser/version (+device/version): Chrome Version 120.0.6099.71 (Official Build) (x86_64)
Any other tested browsers/devices(OK/FAIL): MacOS
URL (minimal example if possible): https://ui5.sap.com/1.120.1/#/entity/sap.m.DatePicker/sample/sap.m.sample.DatePicker
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
- Change chrome timezone to 'Pacific/Apia'
- Refresh ui5 sample page
- Click simple datepicker, select 2023-12-14, the input show 'Dec 13, 2023'
What is the expected result? It should be 'Dec 14, 2023' What happens instead?
Any other information? (attach screenshot if possible) Edge has same problem
Hello @niechenghai,
Thank you for sharing this finding. I've created an internal incident with ID: DINC0012952. The status of the issue will be updated here in GitHub.
Best regards, Boyan
Hello @niechenghai,
The issue was reproducible at the time I was testing and wrote my last message. Currently I'm not able to reproduce it while following the same steps as pointed out in the description. Could you please re-test and confirm if the same issue persists?
It would be great if you could to record a video showcasing the issue and provide your local time at this moment.
Best regards, Boyan
Hello Boyan,
The issue still exists in 1.120.3: https://github.com/SAP/openui5/assets/63828786/3de54578-be83-49c6-8dc4-c766d824125b
Best regards, Chenghai
Hello @niechenghai,
I was able to reproduce it again even with 1.120.1. It seems that this issue is reproducible depending on the local time of the testing. The mentioned incident is still open and in process in our component queue. You'll receive updates here in github.
Best regards, Boyan
Hello @niechenghai,
It seems that I didn't refresh the page after changing the timezone to 'Pacific/Apia' and that was the reason I was reproducing the issue. In such cases there are a mix of date instances already created with local timezone, which in my case is Central European Standard time and the new date instances, which are with the new timezone set through the sensors.
Tested in different local times as well (early in the morning and later in the day) and can't reproduce it anylogner if I refresh the page.
Could you please give us your local timezone and local time at issue reproduction?
Also please make sure that you're refreshing the page after changing the timezone from the sensors.
Best regards, Boyan
hi Boyan,
My local timezone is 'Asia/Shanghai', when change timezone to 'Pacific/Apia' the issue occurs, and I have refreshed the page after change timezone:
https://github.com/SAP/openui5/assets/63828786/9ec985e2-66ff-4e05-b592-aee6e0e60391
Best regards, Chenghai
Hello @niechenghai , after reloading the sample page, the indicated problem does not reproduce. Retrieving the timezone from the browser's sensor occurs when the controls are loaded. It is necessary to refresh the page if you want them to conform to the new timezone of your browser.
Here are the steps you might try:
- Please, open the sample page in a new window.
- Change the settings through the sensor.
- Reload the page.
Best regards, Todor
Hi Todor,
I try to reproduce the issue, it's a little different now, you can try this sample:
First, change timezone to 'Pacific/Apia', then refresh your browser, when you click on 16, the 15 will be selected, if you click on 17 , the 16 will be selected!
Best regards, Chenghai
Screen recording:
https://github.com/SAP/openui5/assets/63828786/de50c19e-4d5d-4969-8307-2f0acf8aef50