Timezone issue breaks booking widget in APAC region

Created on 6 September 2024, 3 months ago
Updated 17 September 2024, 2 months ago

Problem/Motivation

I was having the same issue as 💬 The field appears as a simple text field. Closed: cannot reproduce but I was not seeing any JS errors. I even tried on simplytest.me and used the exact example config provided (with dates modified to be in future), but no luck. I did notice that get-days endpoint was calling the last day of the previous month instead of the first day of the desired month, but didn't guess it was timezone unfortunately until after a bunch of debugging.

Eventually went through the JS line by line and figured out that the problem occurs when the date is converted to ISO time, which defaults to UTC. And for most of the day in Australia, it's actually the previous day in UTC. Hence monthStart getting the end date for the month before.

Maybe this screenshot helps to explain it, my brain is fried!

Note that this is based on the browser setting, not the site setting. If I changed my computer to US East Coast, the widget works.

Steps to reproduce

I *think* you should be able to reproduce this by changing your computer to Brisbane, Australia and trying https://master-ebbfycdpwp8uptzb57xkfyeloikoo5bx.tugboatqa.com/form/test in the European evening, after it has passed midnight in Australia.

Proposed resolution

I am really not sure because converting the date to UTC earlier will probably result in the same issue? So I think the only solution is to avoid use of toISOString()?

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇺Australia pameeela

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

Comments & Activities

Production build 0.71.5 2024