I accept terms and conditions

To make a reservation within 24 hours, directly call +39 0583 494058

'); $e.text(msg); jQuery('.wpcf7-form.cf7_custom_style_1').append($e); } jQuery(document).ready(function() { /* jQuery('input[name="time-257"]') .prop('type', 'time') .prop('step', '900') .prop('required', true) .prop('pattern', '[0-9]{2}:[0-9]{2}') .prop('min', '12:15') .prop('max', '22:30'); */ jQuery('.wpcf7-form.cf7_custom_style_1').on('submit', function(e) { jQuery('.wpcf7-form.cf7_custom_style_1 .wpcf7-response-output.wpcf7-validation-errors').remove(); const date = jQuery('input[name="date-248"]').val(); if (!date) { showError('Please make sure you enter a valid date.'); e.preventDefault(); return; } const day = new Date(date.replace( /(\d{2})\/(\d{2})\/(\d{4})/, "$2/$1/$3")).getDay(); if (day === 2) { showError('Tuesday is our closing day: please choose another day.'); e.preventDefault(); return; } // const time = jQuery('input[name="time-257"]').val(); const time = jQuery('select[name="menu-885"]').children("option:selected").val(); if (!time) { showError('Please choose a valid time.'); e.preventDefault(); return; } const [hours, minutes] = time.split(':'); const mm = (+hours) * 60 + (+minutes); if (day === 3 && (mm 1350)) { showError('On Wednesdays we are only open for dinner: please choose a different time.'); e.preventDefault(); return; } if (day !== 3 && (mm 885 && mm 1350)) { showError('Please choose a time included in our opening hours.'); e.preventDefault(); return; } }); });