HTML and CSS Reference
In-Depth Information
FIguRE 3.4 <input type=date>
on the BlackBerry browser.
FIguRE 3.3 Opera renders a
calendar widget.
Of course, these are still early days. In the future, though,
it's conceivable that, beyond simply showing a shiny new
datepicker, the browser could do something far cleverer, and
call up the native calendar app so you could browse dates to
see your prior appointments. The point is that the browser can
now understand what you mean. Previously, date pickers were—
from the perspective of the browser—nothing more than <div> s,
<span> s, and links with lots of JavaScript behaviour attached.
Now the browser knows that you're in fact entering an actual
time and date and can offer richer controls and integration with
other time/date information.
The time input type
<input type=time> allows input of a time in 24-hour format and
validates it. Once again, the actual user interface is left to the
browser; it could be as simple as entering numbers and throw-
ing an error if the user enters an hour greater than 24 or one
minute greater than 59, or it could be far more elaborate: a
clock face, for example, with draggable hands. The user inter-
face could also allow for entry of a time zone offset.
The datetime input type
Date and time that we've just seen can be combined using
<input type=datetime> to validate a precise date and time.
Local date and time works as datetime except that the browser
doesn't allow the user to add (or change) a time zone offset.
Search WWH ::

Custom Search