You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bad thing. Each call of $this.datepicker('option', 'min/maxDate', ...) makes datepicker and multiDatesPicker to execute onBeforeShow event listeners for each of the days you have visible in your calendar. So in my 1-year calendar (12*35 days ~ 420 days) single attempt to select a day executes onBeforeShow for 3 times for each day! And it takes about 350 ms x 3 times ~ 1.05 sec for stucking. But if you apply my fix (it is available below), you'll be forced to wait 3 times less before you can click another date.
My suggestion is:
It's better to modify those lines to get them this like:
Hi, I've found a performance bottleneck:
Script version: 1.6.1
Problems are found at lines: 105-107 and 109-111
Original code (lines 105-107):
Original code (lines 109-111):
This is a bad thing. Each call of
$this.datepicker('option', 'min/maxDate', ...)
makesdatepicker
andmultiDatesPicker
to executeonBeforeShow
event listeners for each of the days you have visible in your calendar. So in my 1-year calendar (12*35 days ~ 420 days) single attempt to select a day executesonBeforeShow
for 3 times for each day! And it takes about 350 ms x 3 times ~ 1.05 sec for stucking. But if you apply my fix (it is available below), you'll be forced to wait 3 times less before you can click another date.My suggestion is:
It's better to modify those lines to get them this like:
My solution for lines 105-107
My solution for lines 109-111
It improves performance of
onSelect
event for 3 times with the same functionality.Thanks for this great plugin!
The text was updated successfully, but these errors were encountered: