inputs icon indicating copy to clipboard operation
inputs copied to clipboard

fix datetime-local timezone offset

Open mbostock opened this issue 3 years ago • 4 comments

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

mbostock avatar Oct 30 '22 20:10 mbostock

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

mootari avatar Oct 31 '22 09:10 mootari

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

mbostock avatar Oct 31 '22 13:10 mbostock

What I see in this PR is the intended behavior…

Screen Shot 2022-10-31 at 2 41 05 PM

mbostock avatar Oct 31 '22 13:10 mbostock

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

mootari avatar Oct 31 '22 13:10 mootari

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.

recidive avatar Apr 05 '23 15:04 recidive

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 avatar Apr 07 '23 02:04 tophtucker

@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.

tophtucker avatar Jun 16 '23 23:06 tophtucker