-
Notifications
You must be signed in to change notification settings - Fork 17
/
demo.html
100 lines (81 loc) · 3.75 KB
/
demo.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>HTML5 Date polyfill</title>
<meta name="author" content="Jonathan Stipe" />
<meta name="copyright" content="© 2012 Jonathan Stipe" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery.ui.all.css" />
<link rel="stylesheet" href="date-polyfill.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
<script type="text/javascript" src="date-polyfill.js"></script>
<script type="text/javascript">
//<![CDATA[
$(function() {
var dtElem = document.createElement("dt"),
ddElem = document.createElement("dd"),
inputElem = document.createElement("input");
dtElem.appendChild(document.createTextNode("Dynamically generated element"));
$(inputElem).attr({
type: 'date',
name: 'generatedElement',
value: '2000-01-01',
min: '1999-01-01',
max: '2000-12-31'
});
ddElem.appendChild(inputElem);
$('dl').first().append(dtElem).append(ddElem);
$(inputElem).inputDate();
});
//]]>
</script>
</head>
<body>
<form id="form-demo">
<dl>
<dt>date (with value, min, and max)</dt>
<dd><input type="date" name="myDate0" value="2000-01-01" min="1999-01-01" max="2000-12-31" /></dd>
<dt>date (with value and max)</dt>
<dd><input type="date" name="myDate1" value="2000-01-01" max="2000-12-31" /></dd>
<dt>date (with value and min)</dt>
<dd><input type="date" name="myDate2" value="2000-01-01" min="1999-01-01" /></dd>
<dt>date (with value and step)</dt>
<dd><input type="date" name="myDate3" value="2000-01-01" step="7" /></dd>
<dt>date (with value, min, max, and step)</dt>
<dd><input type="date" name="myDate4" value="2000-01-01" min="1999-01-01" max="2000-12-31" step="7" /></dd>
<dt>date (with min and max)</dt>
<dd><input type="date" name="myDate5" min="1999-01-01" max="2000-12-31" /></dd>
<dt>date (with just min)</dt>
<dd><input type="date" name="myDate6" min="1999-01-01" /></dd>
<dt>date (with just max)</dt>
<dd><input type="date" name="myDate7" max="2000-12-31" /></dd>
<dt>date (with just step)</dt>
<dd><input type="date" name="myDate8" step="7" /></dd>
<dt>date (with min, max, and step)</dt>
<dd><input type="date" name="myDate9" min="1999-01-01" max="2000-12-31" step="7" /></dd>
<dt>date (with min and step)</dt>
<dd><input type="date" name="myDate10" min="1999-01-01" step="7" /></dd>
<dt>date (with max and step)</dt>
<dd><input type="date" name="myDate11" max="2000-12-31" step="7" /></dd>
<dt>date (with value, min, max, and step=any)</dt>
<dd><input type="date" name="myDate12" value="2000-07-01" min="2000-01-01" max="2000-12-31" step="any" /></dd>
<dt>date (with value, max, and step=any)</dt>
<dd><input type="date" name="myDate13" value="2000-07-01" max="2000-12-31" step="any" /></dd>
<dt>date (with value, min, and step=any)</dt>
<dd><input type="date" name="myDate14" value="2000-07-01" min="2000-01-01" step="any" /></dd>
<dt>date (with max and step=any)</dt>
<dd><input type="date" name="myDate15" max="2000-12-31" step="any" /></dd>
<dt>date (with min and step=any)</dt>
<dd><input type="date" name="myDate16" min="2000-01-01" step="any" /></dd>
<dt>date (with step=any)</dt>
<dd><input type="date" name="myDate17" step="any" /></dd>
<dt>date (without anything)</dt>
<dd><input type="date" name="myDate18" /></dd>
</dl>
<input type="submit" />
</form>
<a href="https://github.com/jonstipe/date-polyfill">Back to GitHub repo</a>
</body>
</html>