umair96 / jquery-datepicker

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

datePickerMultiMonth showing duplicate months with minDate and maxDate #279

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

using the code and following instructions from the supplied URL

What is the expected output? What do you see instead?

The date input has 'min' and 'max' attributes applied it. I use these to set 
the 'minDate' and 'maxDate' options for datePicker. I also use the two dates to 
decide whether to display 1, 2 or 3 months using 'datePickerMultiMonth'.

The code works fine and the calendar pops up with the correct amount of months, 
the issue is when you 'select a day'. If you select a day (say September 6th), 
then re-click 'choose date' - the calendar has two instances of Septembers 
(because it seems to be using September as the start month).

Is there a way to always force the start month, even when a day has already 
been is selected?

Please provide a URL to a page displaying the problem.

http://paulwelsh.info/sandbox/datePicker/index.html

What version of the datepicker are you using? On what operating system? And 
Which Browser?

jquery.datePicker-2.1.2.js and all browsers/operating systems

Please provide any additional information below.

Original issue reported on code.google.com by welshy1...@gmail.com on 9 May 2011 at 11:20

GoogleCodeExporter commented 8 years ago
You could try passing the "month" and "year" settings objects (as the month and 
year that you want the first calendar to show. Let me know if it helps or not 
and I'll try to investigate further if not...

Original comment by kel...@lucklaboratories.com on 9 May 2011 at 11:55

GoogleCodeExporter commented 8 years ago
sorry, i do not really understand? where do you think i need to pass the 
"month" and "year" too?

Original comment by welshy1...@gmail.com on 9 May 2011 at 12:02

GoogleCodeExporter commented 8 years ago
They are settings parameters as documented here: 
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/documentation.html

So you can pass them the same place you initialise the datePickerMultiMonth 
(along with the clickInput etc)

Original comment by kelvin.l...@gmail.com on 9 May 2011 at 1:09

GoogleCodeExporter commented 8 years ago
ahhh, i hadn't seen the documentation, what an idiot!

i have managed to achieve what i was after not using the "month" setting, but 
instead binding "dateSelected" and using "dpSetDisplayedMonth" to set the month 
back (if needed);

I have updated:

http://paulwelsh.info/sandbox/datePicker/index.html

...with my code and supplied examples of how to use it if anyone else would 
like to use this kind of functionality!

Thanks for the quick responses Kelvin!

Original comment by welshy1...@gmail.com on 9 May 2011 at 2:15

GoogleCodeExporter commented 8 years ago
Great - glad you figured it out and thanks for the update and the example page!

Original comment by kelvin.l...@gmail.com on 9 May 2011 at 2:32