Difference between revisions of "User:Matthew Raymond/date element"
m (SamB moved page User:Matthew Raymond:date element to User:Matthew Raymond/date element: Make actual subpage)
Latest revision as of 17:39, 7 March 2014
The date information provided by the date element can be used for scheduling purposes, or for any other date-related purposes. The actual data is contained in the element's value attribute.
- <date value="2005-01-25">25-Jan-2005</date>
In the above example, the suggested rendering on a Web Forms 2.0 compliant user agent would be the date contained in value in a localized format. For example, the browser may render "January 25th, 2005". Alternatively, it would also be valid to render the child contents of the element, with the localized date displayed as a tooltip. The second rendering, however, is not recommended.
The child contents of a date element are intended for legacy user agent support. Although they can be used by a Web Forms 2.0 compliant browser, the primary intent is that a localized date value be rendered in the place of the contents.
If the value attribute of a date element is not specified, the user agent must check to see if the child contents are a text string containing an ISO 8601 formatted date, and if so, the value of the value attribute should default to that of the child contents.
The above example may be rendered as "February 14th, 2010", or some other localized date string.