Why not just start date and end date. See last example here https://laracasts.com/discuss/channels/guides/getpdo-usage
The difference in days you should be able to work out using carbon or regular PHP date functions, it's just a calculation.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have this code in my Laravel application using JQuery-UI datepicker:
<script type="text/javascript">
$(function () {
$( '.start_date' ).datepicker({
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
duration: 'fast',
minDate: +1,
yearRange: new Date().getFullYear() + ':' + new Date().getFullYear(),
});
$( '.end_date' ).datepicker({
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
duration: 'fast',
minDate: +1,
yearRange: new Date().getFullYear() + ':' + new Date().getFullYear(),
enableOnReadonly: true,
});
});
</script>
<input type="text" id="start_date" placeholder="Start Date"/>
<input type="number" id="daysNumber" placeholder="Days"/>
<input type="text" id="end_date" placeholder="End Date" readonly/>
I have seen some examples, but not really going for JQuery UI.
How do I
onchange daysNumber get end_date from start_date and Days (daysNumber)
and also on select start_date with the value of daysNumber get end_date
using JQuery-UI datepicker
Thanks
Please or to participate in this conversation.