Anita44 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

datePickerMultiMonth very slow in IE #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Make a datePickerMultiMonth object with numMonths:12

What is the expected output? What do you see instead?
In IE7 this takes more than 30 seconds to finish, which means it triggers
the built in dialog if i want to stop the script.

What version of the datepicker are you using? On what operating system? And
Which Browser?
datepicker version: jquery.datePicker.js 84 2009-08-05 17:54:35Z
OS: windows XP
browser: IE7 on an average office PC (~2GHz)

Please provide any additional information below.
I've been searching for a datepicker with multiple select and multiple
visible months for a long time to no avail. When i found your calendar i
was very impressed with it as it contains everything a user could ever
need. Too bad the creation of a large datepicker with 12 months takes so
long to finish...
It would be really nice if you could somehow make it faster, because as it
looks now the time complexity is somehow exponential with the number of
months visible and it might be some kind of a bug.

Thanks for reading.

Original issue reported on code.google.com by matej.lo...@gmail.com on 31 Aug 2009 at 12:50

GoogleCodeExporter commented 9 years ago
Thanks for the bug report.

Unfortunately datePickerMultiMonth is a bit of a hack and just instantiates a 
bunch
of date pickers next to each other. I would love to make it faster but am too 
busy to
do so at the moment. When I have some spare time I will be sure to look into 
this and
see what I can do - if you do any investigation in the meantime and find ways to
speed it up then patches would be appreciated. I think that possibly generating 
the
calendar before appending it to the document may speed things up.

Hope that helps,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 1 Sep 2009 at 10:55

GoogleCodeExporter commented 9 years ago
Thanks for your response :)

I examined your code and found out that the majority of computing time is spent 
on
this line:
basePicker.dpSetDisplayedMonth(1, 3000);

I changed this so that it only forwards the minimum required months to the 
future to
trigger a redraw of all visible elements depending on the numMonths variable:
d=new Date();
var month = s.month || d.getMonth();
var year = s.year || d.getYear();
basePicker.dpSetDisplayedMonth((month+s.numMonths)%12, 
year+Math.floor((month+i)/12));

It is much quicker now, albeit still a bit slow, but i can live with it for now 
:)

Regards,
Matej

Original comment by matej.lo...@gmail.com on 2 Sep 2009 at 1:13

GoogleCodeExporter commented 9 years ago
Issue 116 has been merged into this issue.

Original comment by kelvin.l...@gmail.com on 14 Sep 2009 at 10:11

GoogleCodeExporter commented 9 years ago
Hi... Anyone able to find a solution for slow response in IE6 on using 
jquery.datePickerMultiMonth. I just need 2 months to be displayed side by side..

Original comment by gspadmap...@gmail.com on 14 Oct 2009 at 6:29