2012-09-10 15:33:46 +00:00
|
|
|
<!doctype html>
|
2009-03-14 14:28:10 +00:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2010-09-10 12:50:53 +00:00
|
|
|
<meta charset="utf-8">
|
2015-09-30 13:11:22 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2010-11-19 23:54:49 +00:00
|
|
|
<title>jQuery UI Datepicker - Select a Date Range</title>
|
2013-12-02 18:36:12 +00:00
|
|
|
<link rel="stylesheet" href="../../themes/base/all.css">
|
2010-09-10 12:50:53 +00:00
|
|
|
<link rel="stylesheet" href="../demos.css">
|
2015-05-14 13:51:52 +00:00
|
|
|
<script src="../../external/requirejs/require.js"></script>
|
|
|
|
<script src="../bootstrap.js">
|
2015-02-22 02:58:35 +00:00
|
|
|
var dateFormat = "mm/dd/yy",
|
|
|
|
from = $( "#from" )
|
|
|
|
.datepicker({
|
|
|
|
defaultDate: "+1w",
|
|
|
|
changeMonth: true,
|
|
|
|
numberOfMonths: 3
|
|
|
|
})
|
|
|
|
.on( "change", function() {
|
|
|
|
to.datepicker( "option", "minDate", getDate( this ) );
|
|
|
|
}),
|
|
|
|
to = $( "#to" ).datepicker({
|
|
|
|
defaultDate: "+1w",
|
|
|
|
changeMonth: true,
|
|
|
|
numberOfMonths: 3
|
|
|
|
})
|
|
|
|
.on( "change", function() {
|
|
|
|
from.datepicker( "option", "maxDate", getDate( this ) );
|
|
|
|
});
|
|
|
|
|
|
|
|
function getDate( element ) {
|
|
|
|
var date;
|
|
|
|
try {
|
|
|
|
date = $.datepicker.parseDate( dateFormat, element.value );
|
|
|
|
} catch( error ) {
|
|
|
|
date = null;
|
2009-03-14 14:28:10 +00:00
|
|
|
}
|
2015-02-22 02:58:35 +00:00
|
|
|
|
|
|
|
return date;
|
|
|
|
}
|
2009-03-14 14:28:10 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<label for="from">From</label>
|
2023-03-28 22:18:07 +00:00
|
|
|
<input type="text" id="from" name="from">
|
2009-03-14 14:28:10 +00:00
|
|
|
<label for="to">to</label>
|
2023-03-28 22:18:07 +00:00
|
|
|
<input type="text" id="to" name="to">
|
2009-03-14 14:28:10 +00:00
|
|
|
|
2010-09-10 12:50:53 +00:00
|
|
|
<div class="demo-description">
|
|
|
|
<p>Select the date range to search for.</p>
|
2012-09-10 15:33:46 +00:00
|
|
|
</div>
|
2009-03-14 14:28:10 +00:00
|
|
|
</body>
|
|
|
|
</html>
|