11. date-field

date-field(key, value, ..., key, value)

Inserts in generated content a text field control, configured for parsing and formatting dates. This control can be used to edit the value of the element which is the target of the CSS rule. If "attribute, attribute_name" is specified, this control can be used to edit the value of an attribute of this target element.

A date-field is used to convert a date specified using a normal, localized, format to/from a standard format. For example, the user sees and types something like "03/16/60" in the field (pattern is "MM/dd/yy") and the date actually stored in the XML document is "1960-03-16".

The date stored in the XML contains no time zone information, unless the date format specified by the pattern option contains a z or Z field. Example: the user sees and types something like "60/03/16 02:15 PM +0100" in the field (pattern is "yy/MM/dd hh:mm a Z") and the date actually stored in the XML document is "1960-03-16T13:15:00Z".

Important

The date-field just converts a date format to another. The date-field is not used to validate what the user has typed. As always, the schema of the document is used to perform this validation. Therefore, beware that, when used with a DTD (which unlike W3C XML Schema or RELAX NG does not support data typing), a date-field allows the user to input incorrect date/time values.

See also date-picker.

KeyValueDefaultDescription
attributeQualified name of attribute to be editedNo defaultWithout this parameter, the control is used to edit the value of the element for which the control has been generated.
columnsPositive integerDepends on pattern.Width of the text field in characters.
patternPattern supported by java.text.SimpleDateFormatA simple pattern which depends on data-type.Specifies how date is to be parsed and formatted.
languageLower-case, two-letter codes as defined by ISO-639. Example: "es".Language of default locale.Participates in specifying the locale to use.
countryUpper-case, two-letter codes as defined by ISO-3166. Example: "ES".Country of default locale.Participates in specifying the locale to use.
variantVendor or browser-specific code. Example: "Traditional_WIN".Variant of default locale.Participates in specifying the locale to use.
data-typedate | time | dateTime | gDay | gMonthDay | gMonth | gMonthYear | gYeardate

Base data type of attribute or element value being edited.

Note that default pattern for gMonthDay is MM/dd and default pattern for gYearMonth is yyyy/MM.

Key, value, ..., key, value may also specify style parameters.

Example:

date-field()

date-field(pattern, "yy/MM/dd hh:mm a Z",
           data-type, dateTime,
           language, en, 
           country, "US")