observablehq / inputs

Better input elements
https://observablehq.com/framework/lib/inputs
ISC License
125 stars 34 forks source link

fix datetime-local timezone offset #244

Closed mbostock closed 1 year ago

mbostock commented 1 year ago

Ref. https://talk.observablehq.com/t/input-datetime-fails-the-identity-test/7222/3

mootari commented 1 year ago

Looks like we're already passing the wrong date to the input. From what I understand datetime-local will interpret the date in the local timezone, but we pass a UTC date string, resulting in a wrong time offset.

image

mbostock commented 1 year ago

Is that screenshot testing this PR? Or the released version on Observable?

mbostock commented 1 year ago

What I see in this PR is the intended behavior…

Screen Shot 2022-10-31 at 2 41 05 PM
mootari commented 1 year ago

Sorry, I didn't understand that the PR also takes care of that. Confirmed with a local build that it's fixing the issue.

recidive commented 1 year ago

Any updates on this? The current Inputs.datetime behavior is very odd, and it bugs people working with data that has a lower timeframe where hours are important.

tophtucker commented 1 year ago

Thanks for the bump @recidive; merging now. (And then it may take a day or two for us to get the new version of inputs into the runtime and onto observablehq.com.)

tophtucker commented 1 year ago

@recidive Can you believe I said "a day or two" in April? This just deployed; see test cases here: https://observablehq.com/d/4303b3734fb950d8. So sorry for the delay, life intervened and we've been focused elsewhere. But we've improved our internal processes (namely, more people can publish new releases of these libraries) so this won't be such a bottleneck in the future.