WF2 introduces several new form field types for entering date and time data.
The user interface for these controls are expected to be platform dependant, that is they mimick the standard date/time controls for each platform.
Here is a date control:
The HTML looks like this:
<input type="date">
An initial value should be given in ISO-format, like this: 2004-08-31.
This is also the format in which the value will be submitted to the server.
The HTML looks like this:
<input value="2004-08-31" type="date">
A datetime control is a combined date and time input control. While it looks like two separate fields for the user,
in HTML it is declared as single control of type datetime-local.
The HTML looks like this:
<input type="datetime-local">
There is also a time-control:
The HTML looks like this:
<input value="08:45" type="time">
There is a week selector:
The user can select a week within a specific year, according to the ISO week numbering. The HTML looks like this:
<input value="2004-W42" type="week">
Lastly, there is the month selector, for a specific month in a specific year. This is primarily used for entering credit card expiration dates:
The HTML looks like this:
<input type="month">
The initial datetime should be given in ISO-format, which is formatted like this: 2004-08-31T10:22
This field is declared with a datetime value:
<input value="2004-08-31T10:22" type="datetime-local">
The datetime-local assumes that the input is in the local timezone.
The UTC datetime-control (type="datetime") is the same, except that the value is defined and submitted
in UTC time (which is basically the same as GMT).
The HTML looks like this:
<input value="2004-08-31T10:22" type="datetime">