0
votes

I'm using WordPress 4.6.1 and am trying to use HTML5 inputs for date and time. I tried the datetime-local, date and time types with the input tag and it doesn't want to work.

<input name="expiration-date" type="datetime-local" value="2016-03-14T08:11" required>

Outside of WordPress I have no problem whatsoever, but in WordPress I get the following error in Chrome's dev tools (v53)...

The specified value "20/16/0314" does not conform to the required format. The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".

As you can see, the value that I passed in (or select from the dropdown) is in the valid format it requires. I also tried just the date type as follows:

<input type="date">

And when using the built-in date picker I get the following error: The specified value "20/16/1012" does not conform to the required format, "yyyy-MM-dd". Any suggestions would be great. I don't know if WordPress needs something configured but all other not-date/time HTML5 input types I have used work just fine.

1

1 Answers

0
votes

I found that the input element was inheriting CSS. After the CSS was removed it worked as expected.