mikecoj / MCDatepicker

A vanilla JavaScript Datepicker
https://mcdatepicker.netlify.app/
MIT License
93 stars 18 forks source link

Problem with disableDates #70

Closed Thola68 closed 2 years ago

Thola68 commented 2 years ago

Hello,

The datepicker works fine. I can configure everything - disableMonths, disableYears, markDates ect.

The only thing I can't configure is "disableDates". No reaction, the days can still be selected in the calendar. Any ideas?

MCDatepicker.open('#datepicker'); const datepicker = MCDatepicker.create({ el: '#datepicker', allowedYears: [2022, 2021], bodyType: 'inline', disableWeekDays: [], autoClose: true, dateFormat: 'dd.mm.yyyy', showCalendarDisplay: false, firstWeekday: 1, customWeekDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], customMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], markDates: [new Date(2022, 4, 4), new Date(2022, 6, 11)], disableDates: [new Date(2022, 2, 26), new Date(2022, 12, 27), new Date(2022, 2, 28)] });