Bug 239778 - Datetime-local Field Picker Shows Incorrect Date
Summary: Datetime-local Field Picker Shows Incorrect Date
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 15
Hardware: All macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-26 10:59 PDT by me
Modified: 2022-06-07 17:27 PDT (History)
4 users (show)

See Also:


Attachments
Preview of bug (122.55 KB, image/png)
2022-04-26 10:59 PDT, me
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description me 2022-04-26 10:59:42 PDT
Created attachment 458380 [details]
Preview of bug

It seems the datetime-local field type has a bug where if the seconds end in :00, when you click into the field and it shows the calendar popup it defaults to Dec 2000 w/ Jan 1 2001 selected. If you use any seconds beyond :00, it works fine.

JSFiddle attached, example uses `<input type="datetime-local" value="2017-05-12T19:30:00" step="1">` to show the error.

https://jsfiddle.net/vwyk05gj/
Comment 1 me 2022-04-26 11:00:16 PDT
(Submitted via Feedback also, FB9996513)
Comment 2 Aditya Keerthi 2022-04-26 11:30:02 PDT
rdar://92344761
Comment 3 Mike Wyrzykowski 2022-06-07 13:04:56 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1355
Comment 4 EWS 2022-06-07 17:27:38 PDT
Committed r295369 (251377@main): <https://commits.webkit.org/251377@main>

Reviewed commits have been landed. Closing PR #1355 and removing active labels.