Premium support for our pure JavaScript UI components


Post by jimmycallin »

Hi!

We have set the timezone property, and despite this we are seeing that changes are being returned in the local timezone. Any reason for this, and can we force the set timezone in change handlers? See screen grab and demo app.

Thanks

Attachments
Skärminspelning 2025-05-14 kl. 16.56.45.mov
(21.52 MiB) Downloaded 13 times
scheduler-bugs 4.zip
(133.85 KiB) Downloaded 9 times

Post by marcio »

Hey jimmycallin,

Thanks for reaching out.

If I understood correctly, your situation is similar to the one exposed here viewtopic.php?p=167821#p167821, is that correct?

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by jimmycallin »

I don’t think it’s the same issue, but could be wrong.

My case is pretty simple: If i set timezone to Asia/Shanghai, and I create an event from 09:00 - 15:00, I expect to get back 09:00 - 15:00 Shanghai time, while what I’m seeing is 09:00 - 15:00 local time.


Post by joakim.l »

When a time zone is configured on the project/Scheduler, the events startDate and endDate will be changed so that they match the configured time zone. All work from here on will be treated as it is in that specified time zone.

Since JS time zone support is very limited, we achieve this simply be changing the clock on the dates. So if you read them as strings they will show up as in your local time zone.

If you use our stores or crudmanager to save changes, the dates would be changed back to the local system time zone before sending the request to the server. If you need to do this manually, you can use https://bryntum.com/products/schedulerpro/docs/api/Core/helper/TimeZoneHelper#function-fromTimeZone-static

Regards
Joakim


Post by jimmycallin »

Thank you for your response!

Since JS time zone support is very limited, we achieve this simply be changing the clock on the dates. So if you read them as strings they will show up as in your local time zone.

If I understand you correctly (time zones are hard):

In my screen shot, I have Asia/Tokyo configured, and dragging it to 2025-09-25T00:00:00. What I'm seeing in my console is that changes.startDate is set to 2025-09-25T00:00:00 GMT+2. I would expect it to be 2025-09-24T17:00:00 GMT+2, but to achieve this I need to do TimeZoneHelper.fromTimeZone(changes.startDate, "Asia/Tokyo")?

Skärmavbild 2025-05-14 kl. 23.35.29.png
Skärmavbild 2025-05-14 kl. 23.35.29.png (189.5 KiB) Viewed 93 times

Post by joakim.l »

Yes, I believe that should work fine.

Regards
Joakim


Post Reply