Skip to content

Instantly share code, notes, and snippets.

@oshanz
Created January 25, 2014 05:05
Show Gist options
  • Save oshanz/8612094 to your computer and use it in GitHub Desktop.
Save oshanz/8612094 to your computer and use it in GitHub Desktop.
jquery date range
$(document).ready(function() {
$("#From").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: new Date(),
onClose: function(selectedDate) {
$("#To").datepicker("option", "minDate", selectedDate);
}
});
$("#To").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: new Date(),
onSelect: function() {
getginPage(1);
}
});
$("#From").datepicker('setDate', -7);
$("#To").datepicker('setDate', new Date());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment