t1m0n / air-datepicker

Lightweight, dependency-free JavaScript datepicker.
https://air-datepicker.com
MIT License
2.65k stars 1.37k forks source link

Incorrect disabled state in month and year views (v3.5.3) #637

Open dkirkby opened 1 month ago

dkirkby commented 1 month ago

This works as expected when cellType is "day" but not for "month" or "year":

new AirDatepicker("#picker", {
  onRenderCell: ({date, cellType}) => {
    const disabled = (date.getFullYear() != 2023);
    return { disabled };
  },
})

Specifically, I expected all months to be disabled in the month view when year != 2023, and all years except 2023 to be disabled in the year view.

Here is a jsFiddle demonstrating the problem with v3.5.3.

t1m0n commented 6 days ago

Hi! thanks for the bug report, I'll check