mezoistvan / ng2-flatpickr

Angular 2+ wrapper for flatpickr (https://github.com/chmln/flatpickr)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement all events

josh-k-cb opened this issue · comments

I'd like to be able to leverage onDayCreate from flatpickr2 which would require adding a hook in the config. If this is something you'd consider, you might also provide support for the other events which aren't currently wired up (onMonthChange, onYearChange, etc)
Thanks!

@Josh-Kewley-BC have you managed this event?

Turns out it's available, just not present in the embedded typedef.

private pickrOptions: FlatpickrOptions = {
   minDate: '1-1-2020',
   dateFormat: 'm-d-Y'
 };
this.pickrOptions.onDayCreate = (dObj: any, dStr: any, fp: any, dayElem: any): void => {
     // Utilize dayElem.dateObj, which is the corresponding Date
     const dt = dayElem.dateObj as Date;
    ....
   };