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.01k forks source link

Disabled date off by 1 month #1188

Closed tsegreto closed 5 years ago

tsegreto commented 5 years ago

If you go to the example page, https://amsul.ca/pickadate.js/date/ it gives the example of

$('.datepicker').pickadate({ disable: [ [2015,3,3], [2015,3,12], [2015,3,20] ] })

Yet if you click on the date picker it shows that April (the 4th month of the year) not March (the 3rd month of the year) date's are disabled. What's the deal with this?!?! I am having the same issue with my code, if I input [2019,8,19] it displays Sept 19th 2019 as disabled.

DanielRuf commented 5 years ago

Hi @tsegreto,

did you see the yellow notice on this page? Month is 0-indexed in JavaScript (0 = January, 11 = December).

DanielRuf commented 5 years ago

Closing as this is documented and excepted.