kesarion / angular2-air-datepicker

Angular2 Datepicker | Native implementation of air-datepicker
http://t1m0n.name/air-datepicker/docs/
MIT License
16 stars 10 forks source link

Last day of enabledDateRanges don't trigger airChange #19

Closed rozumny closed 4 years ago

rozumny commented 5 years ago

How to reproduce: 1) initialize option with following data: this.options = { timepicker: false, enabledDateRanges: [ { start: new Date(now - 3 days), end: new Date(now -2 days) } ] }; 2) bind on date changed action (airChange)="dateChanged($event) 3) click on enabled date in calendar 4) nothing happen, dateChanged is not called

kesarion commented 5 years ago

@rozumny Could you try setting the start date at the very beginning of the day (00:00) and the end date at the end of the day (23:59)? For timezone and writing-less-code reasons, that's currently the best way to make sure it works consistently, anytime and anywhere.

The examples might need to be updated, and my little recommendation about setting these dates at the start/end of their respective days might need to be more of a mandatory rule; that or it could be handled auto-magically by the component... which would mean introducing a lot more scenarios than I'd like right now. For the time being, see if setting the limits as described works for you.

rozumny commented 4 years ago

works perfect, thank you!