valueAsDate returns Null on datetime-local input fields
Reported by
yammesi...@gmail.com,
Jul 1 2016
|
|||||||
Issue description
Chrome Version : 53.0.2777.0 (Official Build) canary (64-bit)
URLs (if applicable) :
What steps will reproduce the problem?
(1) Create a datetime-local input element using this line: <input class="form-control" name="event-start-time" id="event-start-time" type="datetime-local" required>
(2) Fill in your birthday date (yay).
(3) Run document.getElementById("event-start-time").valueAsDate
What is the expected result?
Date object with the value of your birthday.
What happens instead?
null
Please provide any additional information below. Attach a screenshot if
possible.
Should return Date object according to W3C: https://www.w3.org/TR/html-markup/input.datetime-local.html
document.getElementById("event-start-time").valueAsNumber works as expected.
Works on <input type="date"> object as expected.
,
Jul 6 2016
Sure. Here you go.
,
Jul 7 2016
Thank you for providing more feedback. Adding requester "kavvaru@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 1 2016
Able to reproduce the issue on windows 7,Linux Ubuntu 14.04 and Mac 10.11.6 using chrome version 52.0.2743.82 and canary 54.0.2815.0.Observed the date object is null.Please find the attached screen shot for the same. Considering this as non regression issue as this is seen from M49 builds.M48 and prior builds are not displaying any results for this issue. Marking it as Untriaged to get more inputs from dev team. Thanks,
,
Aug 2 2016
Assigning tkent@-san.
,
Aug 2 2016
> (2) Fill in your birthday date (yay). Do you mean you fill only year, month, and day, and no time?
,
Aug 2 2016
,
Aug 2 2016
attaching the screen shot for more clarification. Filled all the details year, month, day and time clicked on submit button.Observed the date object is null in devtools console. Thanks,
,
Aug 2 2016
Ah, I see. I remembered this behavior was defined by the standard. https://html.spec.whatwg.org/multipage/forms.html#input-type-attr-summary type=datetime-local should not support valueAsDate as the table shows. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by kavvaru@chromium.org
, Jul 5 2016Labels: Needs-Feedback