amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Disable dates "from": "to" does not work. #1217

Closed kkrieger85 closed 3 years ago

kkrieger85 commented 3 years ago

My usage:


jQuery('#options_date').pickadate({
                        disable:[
                            { from: [2020,12,21], to: [2021,1,3]}
                            ]
                    });

Same like in docs: https://amsul.ca/pickadate.js/date/#disable-dates-use-ranges

But the dates are not shown as disabled.

Any hint on how to solve this?

kkrieger85 commented 3 years ago

Same for:

                jQuery('#options_date').pickadate( {
                        disable:[
                            [2020,12,21],
                            [2020,12,22],
                            [2020,12,23],
                            [2020,12,24],
                            [2020,12,25],
                            [2020,12,26],
                            [2020,12,27],
                            [2020,12,28],
                            [2020,12,29],
                            [2020,12,30],
                            [2020,12,31],
                            [2021,1,1],
                            [2021,1,2],
                            [2021,1,3],
                            ]
                    });
kkrieger85 commented 3 years ago

It seems, that "month" is not counted correctly:

"disable": "[6, 7,{ from: [2020,11,21], to: [2021,0,3]}]"

Disabling days works fine, but disabling exact dates needs to use Month -1 ==> december is 11, not 12

kkrieger85 commented 3 years ago

And "day" is count right: 21st => 21