Today I needed to show a 3 months(multi month) jQuery UI Calendar and need to show current month in the middle. Read "Show multiple months in jQuery datepicker". By default, the current month is always displayed at first place. See the image.
But I need to display the current month (which is September) in the middle. So the order was August -> September -> October.
jQuery UI Datepicker provides a property "showCurrentAtPos" which "specify where in a multi-month display the current month shows, starting from 0 at the top/left." So to show the calendar in middle, set "showCurrentAtPos" to 1.
But I need to display the current month (which is September) in the middle. So the order was August -> September -> October.
jQuery UI Datepicker provides a property "showCurrentAtPos" which "specify where in a multi-month display the current month shows, starting from 0 at the top/left." So to show the calendar in middle, set "showCurrentAtPos" to 1.
$('#inline').datepicker({ numberOfMonths: 3, showCurrentAtPos:1 });And to show in the last, set "showCurrentAtPos" to 2.
$('#inline').datepicker({ numberOfMonths: 3, showCurrentAtPos:2 });See result below
See Complete Code
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment