views:

160

answers:

1

Hi, 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!

+2  A: 

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
Brilliant! Thanks Nick, kicking myself for missing that option :)
Maton