Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElementDateEditor cyclically transforms non UTC dates to UTC on every onChange() #394

Open
vbackeberg opened this issue Apr 24, 2024 · 1 comment · May be fixed by #406
Open

ElementDateEditor cyclically transforms non UTC dates to UTC on every onChange() #394

vbackeberg opened this issue Apr 24, 2024 · 1 comment · May be fixed by #406
Assignees
Labels
question Further information is requested

Comments

@vbackeberg
Copy link

I believe there is an issue with the onChange() code in ElementDateEditor. If the browser timezone is not UTC, it will repeatedly change the timezone to UTC if you click the element.

Expected:
In the "Date and Time" element, after selecting the date field, deselecting it and then selecting it again, it will not change.

Observed:
In the "Date and Time" element, after selecting the date field, deselecting it and then selecting it again, it will transform the timezone to UTC once more.

Steps to reproduce:

  1. Set any timezone except UTC
  2. Add "Date and Time" form element and apply.
  3. Select a date
  4. Click outside the field to trigger onChange()

Fix:
Add timezone to the input date before calling toISOString()

@mikhail-vl mikhail-vl added the question Further information is requested label Apr 24, 2024
@mikhail-vl
Copy link
Member

@vbackeberg Thank you for submitting the issue. We will look into it and get back to you.

@vitPinchuk vitPinchuk linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

Successfully merging a pull request may close this issue.

3 participants