Vivid API

Date Time Picker

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

Usage

import { VDateTimePicker } from '@vonage/vivid-api-vue';
import { registerDateTimePicker } from '@vonage/vivid-api';
registerDateTimePicker('your-prefix');

Locales

Values will be stored in the format YYYY-MM-DDTHH:MM:SS and displayed in the configured locale. Use the locale switcher in the example below to see this in action.

See Localization for more details.

Slots

Helper Text Slot

The helper-text slot allows you to use rich content as the date picker’s helper text.

Contextual Help

The contextual-help slot allows you to add the Contextual Help component next to the label.

API Reference

Properties

PropertyTypeDefaultDescription
clock'12h' | '24h'Forces a 12h or 24h clock to be used.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
errorTextstringProvides a custom error message. Any current error state will be overridden.
helperTextstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
initialValuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
maxstringSets the maximum date and time that can be selected
maxDatestringSets the maximum date that can be selected
maxTimestringSets the maximum time that can be selected
minstringSets the minimum date and time that can be selected
minDatestringSets the minimum date that can be selected
minTimestringSets the minimum time that can be selected
minutesStepnumberDistance between presented minute options.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
readOnlybooleanWhether the date-picker is readonly.
requiredbooleanRequire the field to be completed prior to form submission.
scale'condensed' | 'normal'Sets the display size of the picker field input element.
secondsStepnumberDistance between presented seconds options. If null, seconds are not presented.
value
(modelValue)
stringThe current value of the element.
PropertyTypeDefaultDescription
clock'12h' | '24h'Forces a 12h or 24h clock to be used.
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
error-textstringProvides a custom error message. Any current error state will be overridden.
helper-textstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
valuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
maxstringSets the maximum date and time that can be selected
max-datestringSets the maximum date that can be selected
max-timestringSets the maximum time that can be selected
minstringSets the minimum date and time that can be selected
min-datestringSets the minimum date that can be selected
min-timestringSets the minimum time that can be selected
minutes-stepnumberDistance between presented minute options.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
readonlybooleanWhether the date-picker is readonly.
requiredbooleanRequire the field to be completed prior to form submission.
scale'condensed' | 'normal'Sets the display size of the picker field input element.
seconds-stepnumberDistance between presented seconds options. If null, seconds are not presented.
current-valuestringThe current value of the element.

Slots

NameDescription
contextual-helpSlot for the contextual-help component, displayed next to the label.
helper-textDescribes how to use the date-picker. Alternative to the `helper-text` attribute.
NameDescription
contextual-helpSlot for the contextual-help component, displayed next to the label.
helper-textDescribes how to use the date-picker. Alternative to the `helper-text` attribute.

Events

NameTypeDescription
changeCustomEvent<undefined>Emitted when the date is changed by the user.
inputCustomEvent<undefined>Emitted when the date is changed by the user.
NameTypeDescription
changeCustomEvent<undefined>Emitted when the date is changed by the user.
inputCustomEvent<undefined>Emitted when the date is changed by the user.

Methods

NameParamsReturnsDescription
checkValiditybooleanReturn the current validity of the element.
reportValiditybooleanReturn the current validity of the element. If false, fires an invalid event at the element.