-
Notifications
You must be signed in to change notification settings - Fork 75
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
input-date-picker: selecting day activates previous day in certain cases #9422
Comments
@eriklharper I am not sure, but I think the ticket description is not quite correct, the title is right. The bad issue is in the input-date-picker, where the codepen is here: https://codepen.io/nsulzberger_esri/pen/gOJMjyd |
Thanks Nicole for reporting that! I've added some tests and verification for |
Installed and assigned for verification. |
🍭 Verified locally on Screen.Recording.2024-06-12.at.12.29.47.PM.mov |
Cool, thanks for fixing! |
Check existing issues
Actual Behavior
When I pick a date from earlier times ( e.g. ~1850) from the DatePicker,
event.target.value
returns a day before the selected date.event.target.valueAsDate
returns the correct value.CEST.Date.Picker.Bug.mov
Expected Behavior
event.target.value
returns the equivalent year, month and day asvalueAsDate
.Reproduction Sample
https://codepen.io/nsulzberger_esri/pen/gOJMjyd (input-date-picker)
https://codepen.io/nsulzberger_esri/pen/rNgLKMK (date-picker)
Reproduction Steps
Europe/Zurich
Reproduction Version
2.8
Relevant Info
The current implementation uses the
dateToISO
util function which relies onDate.prototype.toISOString
method on the Date object stored invalueAsDate
.toISOString
returns the date in UTC, not in the local time which is what will be reflected invalueAsDate
, which can lead to discrepancies like this where the two values won't match. SincevalueAsDate
is a Date object and will thus always format in local time, we should avoid usingtoISOString
for computingvalue
.We won't be able to add spec test coverage for changing the
dateToISO
because we can't emulate timezones in the spec environment. We should be able to test in specific timezones in the e2e environment.Regression?
No response
Priority impact
impact - p3 - not time sensitive
Impact
No response
Calcite package
Esri team
Calcite (dev)
The text was updated successfully, but these errors were encountered: