Skip to content

Calendar

This component generates a calendar field to be used in the author dialog. The calendar field’s value is passed to the component as a prop.

PropertyTypeDescriptionDefault ValueRequired
labelstringThe label of the calendar componentYes
placeholderstringPlaceholder text for the calendar fieldNo
valueformatstringFormat of the value returned by the calendarYes
displayformatstringFormat of the date displayed in the calendarYes
headerformatstringFormat of the header displayed in the calendarYes
startdaystringThe start day of the weekNo
minstringMinimum date that can be selectedNo
maxstringMaximum date that can be selectedNo
defaultValuestringDefault value for the calendar componentNo

To use a calendar component in the author dialog, we can use the following code:

{
calendar: calendar({
label: 'Calendar',
placeholder: 'Select a date',
valueformat: 'YYYY-MM-DD',
displayformat: 'MM/DD/YYYY',
headerformat: 'MMMM YYYY',
startday: '0',
min: '2023-01-01',
max: '2023-12-31',
defaultValue: '2023-06-15',
})
}
type CalendarOutputType = string;

Calendar Component Calendar Component