Skip to content Skip to sidebar Skip to footer

Datepicker, Mindate, Maxdate + Dateformat Issue

I have an issue with the dateformat in a form using datepicker. In my form, I have 2 date fields -> Start Date and End Date. I want Start Date < End Date. So I use the minDa

Solution 1:

Another Solution

$(document).ready(function() {
$.datepicker.setDefaults({
      dateFormat: 'dd-mm-yy',
   });
    $('#startdate').datepicker({
          onSelect: function(selectedDate) {
                $('#enddate').datepicker('option', 'minDate', selectedDate );
          }
    });
    $('#enddate').datepicker({
          onSelect: function(selectedDate) {
                $('#startdate').datepicker('option', 'maxDate', selectedDate );
          }
    });

});

Fork fiddle link

Solution 2:

Post a Comment for "Datepicker, Mindate, Maxdate + Dateformat Issue"