9

I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the current month selected to be the last calendar i.e. March, April, May instead of the current implementation which is May, June, July.

Greatly appreciate any help!

Maton
  • 167
  • 1
  • 2
  • 8

1 Answers1

13

Use the showCurrentAtPos option just for that purpose:

Specify where in a multi-month display the current month shows, starting from 0 at the top/left.

The usage looks like this:

$("#datepicker").datepicker({
    numberOfMonths: 3,
    showCurrentAtPos: 2
});​

Since it's zero-based, 2 would be the right-most, you can see a working demo here.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
  • Brilliant! Thanks Nick, kicking myself for missing that option :) – Maton May 30 '10 at 23:42
  • Hi nick , I am trying to keep the currently selected month in the same place and not have it rotated. Can you please take a look at this question of mine? http://stackoverflow.com/questions/11511051/jquery-ui-multi-date-picker-stop-rotating-months-on-date-select – Shaunak Jul 18 '12 at 14:24