Events
| Property | Type | Description |
|---|---|---|
onChange | function | (optional) Will be called on a date change event. Returns an object. See Returned Object below. |
onType | function | (optional) Will be called on every input and date picker interaction. Returns an object. See Returned Object below. |
onSubmit | function | (optional) Will be called once a user presses the submit button. |
onCancel | function | (optional) Will be called once a user presses the cancel button. |
onReset | function | (optional) Will be called once a user presses the reset button. |
onShow | function | (optional) Will be called once date-picker is visible. |
onHide | function | (optional) Will be called once date-picker is hidden. |
onDaysRender | function | (optional) Will be called right before every new calendar view gets rendered. See the example above. |
onFocus | function | (optional) Will be called once the input gets focus. |
onBlur | function | (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 }}