<input name="datetime" type="datetime-local" />
The above input only works with valueAsNumber, when I switch to valueAsDate it returns null.
I guess it's because failed to convert into Date?
<input name="datetime" type="datetime-local" />
The above input only works with valueAsNumber, when I switch to valueAsDate it returns null.
I guess it's because failed to convert into Date?
Your input is not a date, it is a datetime
You are correct, it failed to convert into Date.
You could do this instead:
var datevalue = new Date(myinput.value);