ng2-flatpickr icon indicating copy to clipboard operation
ng2-flatpickr copied to clipboard

Implement all events

Open josh-k-cb opened this issue 3 years ago • 2 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-k-cb avatar Mar 30 '21 16:03 josh-k-cb

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

CrackerakiUA avatar Apr 16 '21 09:04 CrackerakiUA

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;
    ....
   };

josh-k-cb avatar Apr 16 '21 13:04 josh-k-cb