Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery(function() {
// Check the date range, 86400000 is the number of milliseconds in one day
$("#start_date").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
onSelect: function(selected) {
$("#end_date").datepicker("option","minDate", selected)
}
});
$("#end_date").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: $("#start_date").val(),
onSelect: function(selected) {
$("#start_date").datepicker("option","maxDate", selected)
}
});
});
$(function() {
// Check the date range, 86400000 is the number of milliseconds in one day
$("#start_date").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
onSelect: function(selected) {
$("#end_date").datepicker("option","minDate", selected)
}
});
$("#end_date").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: $("#start_date").val(),
onSelect: function(selected) {
$("#start_date").datepicker("option","maxDate", selected)
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.