Vivid Logo Vivid

Date Time Picker

Combines an Input and a Calendar/Time Picker popover to allow users to enter or select a date and time.

Labelling

Label Text

The label attribute provides a short description of the purpose of the Date Picker.

If a visible label can't be used, provide one using the aria-label attribute. This ensures screen readers announce the purpose of the element, making it accessible to all users.

Helper Text

The helper-text attribute provides additional information to help the user enter the correct information.

To add HTML to the helper text, use the helper-text slot.

Contextual Help

You can add the Contextual Help component using the contextual-help slot. It will be displayed next to the label, providing users additional information.

Validation Feedback

Error Text

The error-text attribute provides a custom error message. Any current error state will be overridden by error-text.

Value

The value attribute contains the currently selected date and time.

Empty string or undefined represent no value being selected.

It will always contain a valid value in the format YYYY-MM-DDTHH:MM:SS when a value is selected. If the user enters an invalid value, value will be empty.

The Date Time Picker is time zone agnostic. You need to ensure that value is interpreted correctly in your application.

Min

Set the min attribute to configure the earliest value to accept. The user will be prevented from choosing an earlier value, however it is still possible to manually enter one.

Min Date

Set the min-date attribute to configure the earliest date to accept. The user will be prevented from choosing an earlier date, however it is still possible to manually enter one.

The min-date attribute will take precedence over the min attribute.

Min Time

Set the min-time attribute to configure the earliest time to accept. The user will be prevented from choosing an earlier time, however it is still possible to manually enter one.

The min-time attribute will take precedence over the min attribute.

Max

Set the max attribute to configure the latest date to accept. The user will be prevented from choosing an later date, however it is still possible to manually enter one.

Max Date

Set the max-date attribute to configure the latest date to accept. The user will be prevented from choosing a later date, however it is still possible to manually enter one.

The max-date attribute will take precedence over the max attribute.

Max Time

Set the max-time attribute to configure the latest time to accept. The user will be prevented from choosing a later time, however it is still possible to manually enter one.

The max-time attribute will take precedence over the max attribute.

Clock

The Date Time Picker will display the time in 12h or 24h format depending on the configured locale.

Use the clock attribute to override this behavior.

Minutes Step

Use the minutes-step attribute to configure the step between minutes in the Date Time Picker.

Seconds Step

Use the seconds-step attribute to configure the step between seconds in the Date Time Picker.

If not set, the Date Time Picker will not display seconds.

Scale

The scale attribute controls the Date Time Picker input element display size.

Disabled

Add the disabled attribute to disable the Date Time Picker.

Readonly

Add the readonly attribute to make the Date Time Picker readonly.