var k_firstdate="07/04/2010"; $(function(){ var firstdate=new Date(); firstdate.setDate(firstdate.getDate()+5); firstdate=firstdate.asString(); var endDate = new Date(); endDate.setTime(endDate.getTime() + 86400 * 1000 * 365); endDate=endDate.asString(); // initialise the "Select date" link $('#date-pick_l') .datePicker( // associate the link with a date picker { createButton:false, startDate:firstdate, endDate:endDate //'31/12/2012' } ).live( // when the link is clicked display the date picker 'click', function() { $(this).dpDisplay(); return false; } ).bind( 'dateSelected', function(e, selectedDate, $td, state){ $('#delivery').attr('value', selectedDate.asString('dd/mm/yyyy')); } ).bind( 'dpClosed', function(e, selected) { $('#delivery').removeClass('mandatoryError'); } ); // initialise the "Select date" link $('#date-pick_h') .datePicker( // associate the link with a date picker { createButton:false, startDate:firstdate, endDate:endDate//'31/12/2012' } ).live( // when the link is clicked display the date picker 'click', function() { $(this).dpDisplay(); return false; } ).bind( 'dateSelected', function(e, selectedDate, $td, state) { $('#wedding').attr('value', selectedDate.asString('dd/mm/yyyy')); } ).bind( 'dpClosed', function(e, selected) { } ); // default the position of the selects to today var today = new Date(); });