I have a datetime-local input.
I wish I had the ability to mandatory specify a date and optionally an hour.
Only, even when I indicate both, a warning occurs preventing me to get the input value.
Here is the warning message in question:
The specified value "0000-00-00T00:00" does not conform to the required format. The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
I don't see where does the error or how to solve it.
moment(new Date()).format('YYYY-MM-DDTHH:mm')
Using moment.js it works with this format for type="datetime-local"
The format is valid, the date is invalid: 0th of month 0 of year 0 don't exists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With