Skip to content

Events

PropertyTypeDescription
onChangefunction(optional) Will be called on a date change event. Returns an object. See Returned Object below.
onTypefunction(optional) Will be called on every input and date picker interaction. Returns an object. See Returned Object below.
onSubmitfunction(optional) Will be called once a user presses the submit button.
onCancelfunction(optional) Will be called once a user presses the cancel button.
onResetfunction(optional) Will be called once a user presses the reset button.
onShowfunction(optional) Will be called once date-picker is visible.
onHidefunction(optional) Will be called once date-picker is hidden.
onDaysRenderfunction(optional) Will be called right before every new calendar view gets rendered. See the example above.
onFocusfunction(optional) Will be called once the input gets focus.
onBlurfunction(optional) Will be called once the input lose focus.

Returned Object

The type of native event will depend on the interaction. All additional HTML attributes will be returned as well.

{
date: null | 'date as `returnFormat` | `yyyy-MM-dd` ', /* Available if `range` is `false` */
start_date: null | 'date as `returnFormat` | `yyyy-MM-dd`', /* Available if `range` is `true` */
end_date: null | 'date as `returnFormat` | `yyyy-MM-dd`', /* Available if `range` is `true` */
invalidDate: null | 'date as `returnFormat` | `yyyy-MM-dd`', /* Available if `range` is `false` */
invalidStartDate: null | 'date as `returnFormat` | ´yyyy-MM-dd`', /* Available if `range` is `true` */
invalidEndDate: null | 'date as `returnFormat` | `yyyy-MM-dd`', /* Available if `range` is `true` */
partialDate: null | 'date as `returnFormat` | `yyyy-MM-dd`' /* Available if `range` is `false` */
partialStartDate: null | 'date as `returnFormat` | `yyyy-MM-dd`' /* Available if `range` is `true` */
partialEndDate: null | 'date as `returnFormat` | `yyyy-MM-dd`' /* Available if `range` is `true` */
days_between: number,
attributes: { attributes },
event: null | { native event }
}