aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual/datepicker/datepicker.html
blob: d5f5694912a99563b615662e4043aeecc305b11a (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!doctype html>
<html lang="en">
<head>
	<title>Simple Datepicker</title>
	<link rel="stylesheet" href="../all.css" type="text/css">
	<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
	<script type="text/javascript" src="../../../jquery-1.4.2.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript">
	$(function() {
		// simple datepicker
		$('#d1').datepicker();
		$('button.disable-d1').click(function(event){
			$('#d1').datepicker('disable');
			event.preventDefault();
		});
		$('button.enable-d1').click(function(event){
			$('#d1').datepicker('enable');
			event.preventDefault();
		});
		$('button.destroy-d1').click(function(event){
			$('#d1').datepicker('destroy');
			event.preventDefault();
		});
		
		// multi datepicker
		$('#d2').datepicker({numberOfMonths: 3, showButtonPanel: true});
		$('button.disable-d2').click(function(event){
			$('#d2').datepicker('disable');
			event.preventDefault();
		});
		$('button.enable-d2').click(function(event){
			$('#d2').datepicker('enable');
			event.preventDefault();
		});
		$('button.destroy-d2').click(function(event){
			$('#d2').datepicker('destroy');
			event.preventDefault();
		});
		
		// inline datepicker
		$('#inl').datepicker({minDate: -20, maxDate: '+1M +10D'});
		$('button.disable-inl').click(function(event){
			$('#inl').datepicker('disable');
			event.preventDefault();
		});
		$('button.enable-inl').click(function(event){
			$('#inl').datepicker('enable');
			event.preventDefault();
		});
		$('button.destroy-inl').click(function(event){
			$('#inl').datepicker('destroy');
			event.preventDefault();
		});
		
		// disabled input datepicker
		$('#d3').datepicker();		

		// bottom-right datepicker
		$('#d4').datepicker({numberOfMonths: 3});		
	});
	</script>
</head>
<body>

<ul class="plugins">
	<li class="plugin">
		<button class="disable-d1">Disable</button>
		<button class="enable-d1">Enable</button>
		<button class="destroy-d1">Destroy</button>

		Datepicker Simple
		<div>
			<input type="text" id="d1" />
		</div>
	</li>
	<li class="plugin">
		<button class="disable-d2">Disable</button>
		<button class="enable-d2">Enable</button>
		<button class="destroy-d2">Destroy</button>

		Datepicker Multi
		<div>
			<input type="text" id="d2" />
		</div>
	</li>
	<li class="plugin">
		<button class="disable-inl">Disable</button>
		<button class="enable-inl">Enable</button>
		<button class="destroy-inl">Destroy</button>

		Datepicker Inline
		<div id="inl"></div>
	</li>
	<li class="plugin">
		Datepicker disabled input
		<div>
			<input type="text" id="d3" disabled="disabled" />
		</div>
	</li>
	<li class="plugin" style="position: absolute; right: 0; bottom: 0; height: 40px">
		Datepicker - positioned bottom-right
		<div>
			<input type="text" id="d4">
		</div>
	</li>	
</ul>

</body>
</html>