Calendar Check out date = check in date +1day
-
I use contact form 7.
I have a check-in-date and a check-out-date field.
When a user selects the check-in-date, then when he clicks the check-out-date it should show automatically on the calendar the “check in date plus 1 day”.
What i want is similar to all the booking calendar forms we see out there.I us this code:
CheckIn
[date* Salida-157 min:today max:2022-12-31 step:1 class:required “2021-03-04”]
CheckOut
[date* Salida-158 min:today max:2022-12-31 step:1 class:required “2021-03-05”]I found this code but I dont really know if it works:
jQuery(function($){ $("#date1").datepicker({ dateFormat: 'dd/mm/yy', onSelect : function (selected) { var unique = $(this).attr('id'); unique = unique.replace('date1', ''); var date = $(this).datepicker('getDate'); if (date) { date.setDate(date.getDate() + 1); } $( '#date2' + unique).datepicker( 'option', 'minDate', date) } }); });
Best Regards
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Calendar Check out date = check in date +1day’ is closed to new replies.