Selecting month/year in Availability module
Posted: Mon Aug 30, 2010 7:01 pm
Hi,
I am using the Availability module in conjuction with CGCalendar which is great, but the client requires a select box drop down to jump to a particular month/year, instead of the standard 'prev' and 'next'.
I thought I had figured this out myself by using jQuery to refresh the page with variables added to the url, to set the variables in the section '...month=$month year=$year....' in the calendar template. This works, except for the fact that the number of days visible doesn't change according to the month - it stays the same as the current month. Is there an easier way I can achieve this?
The jQuery I am using is:
$(document).ready(function(){
$('#go').click(function(){
$selmonth = $('.#newmonth :selected').attr("value");
$selyear = $('.#newyear :selected').attr("value");
location.href = ("booking-and-prices?apart={/literal}{$smarty.get.apart}{literal}&newyear="+$selyear+"&newmonth="+$selmonth);
});
});
Thanks!
I am using the Availability module in conjuction with CGCalendar which is great, but the client requires a select box drop down to jump to a particular month/year, instead of the standard 'prev' and 'next'.
I thought I had figured this out myself by using jQuery to refresh the page with variables added to the url, to set the variables in the section '...month=$month year=$year....' in the calendar template. This works, except for the fact that the number of days visible doesn't change according to the month - it stays the same as the current month. Is there an easier way I can achieve this?
The jQuery I am using is:
$(document).ready(function(){
$('#go').click(function(){
$selmonth = $('.#newmonth :selected').attr("value");
$selyear = $('.#newyear :selected').attr("value");
location.href = ("booking-and-prices?apart={/literal}{$smarty.get.apart}{literal}&newyear="+$selyear+"&newmonth="+$selmonth);
});
});
Thanks!