uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.68k stars 6.06k forks source link

[Timing Bug] on setDateDisabled + start/end date #1691

Open blag001 opened 9 years ago

blag001 commented 9 years ago

Hello, I'm facing a really strange bug that seem to be timing related. I want to change on the fly the date disabled, using some input-binded data (aka I've got a bunch of field, and for some I need to merge the default dateDisable with the data-dateDisable input prop). I use the default start/end date too, to only allow a part of the year. The bug is that I can't change the month if the actual date value is in the start/end date range. Else, I'm stuck on the month of startDate

Some code better than a long speech : https://jsfiddle.net/zj9sjspf/10/

The worst part is that you actually can "patch" this bug just by un-comment the alert box.

I've tried to take a look at the code, but as I'm not familiar with js plugin syntax & I can't find anything...

Thanks, Blag

ps : I've make a StackOverflow Question, in case someone found why.

blag001 commented 9 years ago

Seem the on('show') fire more than one time, and that is why the datepicker froze. Workaround for now : disable showOnFocus, handle it by yourself and trigger the show when done with your custom option; by @xjedam