0

I got a greater example of validating period with date picker without time. Is it possible to make the validation with date and time together?

The Example from: http://www.jquerybyexample.net/2012/01/end-date-should-not-be-greater-than.html

$(document).ready(function() {
  $("#txtFromDate").datepicker({
    minDate: 0,
    maxDate: "+60D",
    numberOfMonths: 2,
    onSelect: function(selected) {
      $("#txtToDate").datepicker("option", "minDate", selected)
    }
  });
  $("#txtToDate").datepicker({
    minDate: 0,
    maxDate: "+60D",
    numberOfMonths: 2,
    onSelect: function(selected) {
      $("#txtFromDate").datepicker("option", "maxDate", selected)
    }
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" /> From:
<input type="text" id="txtFromDate" /> To:
<input type="text" id="txtToDate" />
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Salah Salem
  • 81
  • 1
  • 1
  • 8

0 Answers0