I am developing a simple check-in and check-out form with Datepicker and I made it to always display the checkin as today, and checkout as tomorrow.
<?php
$today = date("Y-m-d");
$tomorrow = new DateTime('tomorrow');
?>
<div class="row">
<input type="text" class="datepicker" name="datein" value="<?php echo $today; ?>" readonly='true'>
<input type="text" class="datepicker" name="dateout" value="<?php echo $tomorrow->format('Y-m-d'); ?>" readonly='true'>
</div>
And I want the checkout date to be always the checkin + 1 day. Is there a way to dynamically check the checkin value and update the checkout on any event, or should I take a different approach?
Thank you