• Resolved pierremartin310

    (@pierremartin310)


    Hello,
    How can i set the min date and the max date?
    And How can I set date2>date1 + 1 (reservation purpose)

    Thank for your answer!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello… any solution? i’d like set minimum date of second date field next days than first selected date field… is a reservation form, checkin and checkout date… i need block checkout date for past date than selected checkin date.

    Thread Starter pierremartin310

    (@pierremartin310)

    Hello,
    At the end of your form, add a Script like this:

    Your form…

    <script type=”text/javascript”>
    jQuery(document).ready(function($) {
    $(‘.date_picker’).datepicker({
    dateFormat : ‘dd/mm/yy’,
    firstDay: 1,
    minDate: 0,
    maxDate: new Date(‘2022-10-15’),
    onSelect : function (selected) {
    var unique = jQuery(this).attr(‘id’);
    unique = unique.replace(‘date1’, ”);
    var date = jQuery(this).datepicker(‘getDate’);
    if (date) {
    date.setDate(date.getDate() + 1);
    }
    jQuery( ‘#date2’ + unique).datepicker( ‘option’, ‘minDate’, date)
    }
    });
    });
    </script>`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘min date and max date’ is closed to new replies.