" + arr[0] + "
" + arr[1] + "

"); jQuery('#formatted_date_to').datepicker("setDate", departureDate ); jQuery('#date_to').val(newToDateArr[2] + newToDateArr[3] +newToDateArr[1]); jQuery('.initial-departure-date').html("

" + newToDateArr[0] + "
" + newToDateArr[1] + "

"); } else if (this.classList.contains('date-departure')){ jQuery('#date_to').val(newToDateArr[2] + newToDateArr[3] +newToDateArr[1]); jQuery('.initial-departure-date').html("

" + newToDateArr[0] + "
" + newToDateArr[1] + "

"); } } }); });

/* Book Now Form - Validation */ jQuery('.book-now-button-home').click(function(){ jQuery('.book-now-form').submit(); });

jQuery(document).ready(function(){ /* Populating initial datepicker on homepage booking widget */ var today = jQuery(".date-today").datepicker('setDate', new Date()).val(); var date1 = jQuery('.date-today').datepicker('getDate'); var date2 = jQuery('.date-today').datepicker('getDate'); date1.setDate(date1.getDate()); date2.setDate(date2.getDate() + 7); date1 = jQuery.datepicker.formatDate("MM dd yy mm",date1); date2 = jQuery.datepicker.formatDate("MM dd yy mm",date2); var todayarr = today.toString().split(" "); var date1arr = date1.toString().split(" "); var date2arr = date2.toString().split(" "); todayarr[1] = todayarr[1].toString().replace(/,/g, ''); jQuery('.initial-arrival-date').html("

" + todayarr[0] + "
" + todayarr[1] + "

"); jQuery('.initial-departure-date').html("

" + date2arr[0] + "
" + date2arr[1] + "

"); jQuery('#date_from').val(date1arr[2] + date1arr[3] +date1arr[1]); jQuery('#date_to').val(date2arr[2] + date2arr[3] +date2arr[1]); });

/* Guest input box - homepage booking widget */ jQuery(document).ready(function() { jQuery('.minus').click(function () { var $input = jQuery(this).parent().find('input'); var count = parseInt($input.val()) - 1; count = count < 1 ? 1 : count; $input.val(count); $input.change(); return false; }); jQuery('.plus').click(function () { var $input = jQuery(this).parent().find('input'); $input.val(parseInt($input.val()) + 1); $input.change(); return false; }); });