replied on August 9, 2022
There's a couple ways you could do this.
The easiest way is to use JavaScript to update the min date attribute each time the Start Date changes.
In the following the class startDate is added to the Start Date field and the class endDate is added to the End Date field and it updates the allowed range whenever Start Date changes.
$(document).ready(function(){
$('.startDate input').on('change', function(){
// use start date value or blank if start date is not set
// adjust the MM/DD/YYYY portion if you're using different formatting in your field
// the YYYY-MM-DD needs to stay the same because that's how the min/max are set
var minDate = $(this).val() != '' ? moment($(this).val(),'MM/DD/YYYY').format('YYYY-MM-DD') : '';
// set min date and revalidate field
$('.endDate input').attr('min', minDate).parsley().validate();
});
});
If you don't want to let them be equal, then you'd need a little more.