10. date-time-picker
Prev | Chapter 5. Content objects | Next

## 10. date-time-picker

date-time-picker(`key`, `value`, ..., `key`, `value`)

Inserts in generated content a text field control and a button which displays a dialog box allowing to select a date/time. 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.

Unlike what happens with a date-field, the same date format is used to display the value on screen and to store it in the XML document. This allows to use a `date-time-picker` for data types other than those deriving from `xs:dateTime`.

Example:

    <xs:element name="dateTime31" type="DateTime31" />
    ...
    <xs:complexType name="DateTime31">
      <xs:attribute name="value" type="DateTime41" default="1315 03/16/1960" />
    </xs:complexType>

    <xs:simpleType name="DateTime41">
      <xs:restriction base="xs:token">
        <xs:pattern value="\d\d\d\d \d\d/\d\d/\d\d\d\d" />
      </xs:restriction>
    </xs:simpleType>

may be edited using:

    dateTime31 {
        content: date-time-picker(attribute, value,
                                  format, pattern,
                                  pattern, "HHmm MM/dd/yyyy",
                                  language, en,
                                  country, "US");
    }

Key | Value | Default | Description
--- | --- | --- | ---
attribute | Qualified name of attribute to be edited | No default | Without this parameter, the control is used to edit the value of the element for which the control has been generated.
columns | Positive integer | Depends on `format` and on `pattern`. | Width of the text field in characters.

format

`standard` | `standard-omit-time-zone` | `pattern` | `seconds-since-epoch` | `millis-since-epoch`

`standard-omit-time-zone`

Specifies the format of the date/time value.

standard

  Standard format of a `xs:dateTime` (W3C XML Schema standard data type), with the time zone part.

  Example: `2001-09-11T11:30:00Z`.

standard-omit-time-zone

  Standard format of a `xs:dateTime` (W3C XML Schema standard data type), without the time zone part.

  Example: `2007-10-18T09:16:26`.

pattern

  The format of the date/time value is the one specified by the `pattern` option (see below).

  Example: `1415 03/16/1960` (for `pattern`="`HHmm MM/dd/yyyy`")

seconds-since-epoch

  Number of seconds since January 1, 1970 GMT. A real number (`double`).

  Example: `1.192699294E9`.

millis-since-epoch

  Number of milliseconds since January 1, 1970 GMT. An integer (`long`).

  Example: `1192699313795`.

pattern | Pattern supported by `java.text.SimpleDateFormat` | A default, short, pattern depending on the locale being used. | Specifies the format of the date. Ignored unless `format`=`pattern`.
language | Lower-case, two-letter codes as defined by ISO-639. Example: "es". | Language of default locale. | Participates in specifying the locale to use.
country | Upper-case, two-letter codes as defined by ISO-3166. Example: "ES". | Country of default locale. | Participates in specifying the locale to use.
variant | Vendor or browser-specific code. Example: "Traditional_WIN". | Variant of default locale. | Participates in specifying the locale to use.

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

Examples:

    dateTime30 {
        content: date-time-picker(attribute, value,
                                  format, standard,
                                  columns, 25);
    }

    dateTime41 {
        content: date-time-picker(format, pattern,
                                  pattern, "HHmm MM/dd/yyyy",
                                  language, en,
                                  country, "US");
    }

    dateTime43 {
        content: date-time-picker(format, millis-since-epoch);
    }

Prev | Up | Next
9. date-field | Home | 11. date-picker