/
datepicker.html
48 lines (46 loc) · 1.15 KB
/
datepicker.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="jquery-ui/jquery-ui.min.css"/>
<style>
<!--custome style here-->
</style>
</head>
<body>
<label for="from">From</label>
<input type="text" id="from" name="from">
<label for="to">to</label>
<input type="text" id="to" name="to">
<!--body content here--->
<script src="jquery-ui/external/jquery/jquery.js"></script>
<script src="jquery-ui/jquery-ui.min.js"></script>
<script src="jquery-ui/datepicker-zh-CN.js"></script>
<script>
<!--scripts here-->
$(function() {
$( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#from" ).datepicker("option",
$.datepicker.regional[ "zh-CN" ]
);
$( "#to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
$( "#from" ).datepicker("option",
$.datepicker.regional[ "zh-CN" ]
);
});
</script>
</body>
</html>