engineer9090909090909090 / jquery-datepicker

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

I want a reloaded datepicker to begin in the month that the selected day is in #229

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Select a date with the date picker
2. Go back to the date picker
3. Choose a different month or year but don't select a date
4. Click somewhere else to exit the date picker
5. Go back to the date picker... the most recent view is shown still - I want 
it to start on the month that the select day is in.

What is the expected output? What do you see instead?
The most recent month/year is shown when you go back to the date picker - I 
want to show the month the selected day is in when you redisplay the date 
picker...

Please provide a URL to a page displaying the problem.
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePicker.html

What version of the datepicker are you using? On what operating system? And 
Which Browser?
2.2.1, Windows XP, Google Chrome 5

Please provide any additional information below.

Original issue reported on code.google.com by iljwamh1...@gmail.com on 27 Jul 2010 at 2:48

GoogleCodeExporter commented 8 years ago
The current behaviour is as intended and I believe more usable than what you 
are looking for. However, it should be pretty easy for you to get the behaviour 
that you want - something like this:

$('#element').datePicker().bind('dpClosed', function(event, selected) {
  var selectedDate = selected[0];
  $('#element').dpSetDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear());
});

(untested code but should give you a good idea of what you want to do - 
basically set the displayed month to the month containing the selected date 
whenever the date picker is closed).

Hope it helps!

Original comment by kelvin.l...@gmail.com on 27 Jul 2010 at 8:01

GoogleCodeExporter commented 8 years ago
Thanks!!! 

Original comment by iljwamh1...@gmail.com on 27 Jul 2010 at 9:47