I have a jquery datepicker setup. I have customized this so that inside the datepicker div, I have created a custom menu with some months like so:
<div class="custom_menu">
<div class="month">January 2012</div>
<div class="month">February 2012</div>
<div class="month">March 2012</div>
</div>
What I am looking to do is when the user clicks on a month I want the datepicker to update it’s view with that month e.g. some psuedocode
$('.month').live('click', function(){
var newmonth = $(this).text(); //get the month in a suitable format
$('#current_datpicker').update('month', newmonth); //update the datepicker to show this month
});
Can I do something like this, looking at the API docmentation does not show anything…
EDIT
The problem I am facing is how to get the #current_datepicker (i.e. the correct datepicker id) when I have more than 1 instance of a datepicker on the page? Is the current datepicker trigger input id stored somewhere?
source
Though
$(this).text()won’t give you only the month, you need to remove the year: