-
Notifications
You must be signed in to change notification settings - Fork 5
/
demo.html
100 lines (81 loc) · 3.69 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 Week 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="week-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="week-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: 'week',
name: 'generatedElement',
value: '2000-W01',
min: '1999-W01',
max: '2000-W52'
});
ddElem.appendChild(inputElem);
$('dl').first().append(dtElem).append(ddElem);
$(inputElem).inputWeek();
});
//]]>
</script>
</head>
<body>
<form id="form-demo">
<dl>
<dt>week (with value, min, and max)</dt>
<dd><input type="week" name="myWeek0" value="2000-W01" min="1999-W01" max="2000-W52" /></dd>
<dt>week (with value and max)</dt>
<dd><input type="week" name="myWeek1" value="2000-W01" max="2000-W52" /></dd>
<dt>week (with value and min)</dt>
<dd><input type="week" name="myWeek2" value="2000-W01" min="1999-W01" /></dd>
<dt>week (with value and step)</dt>
<dd><input type="week" name="myWeek3" value="2000-W01" step="4" /></dd>
<dt>week (with value, min, max, and step)</dt>
<dd><input type="week" name="myWeek4" value="2000-W01" min="1999-W01" max="2000-W52" step="2" /></dd>
<dt>week (with min and max)</dt>
<dd><input type="week" name="myWeek5" min="1999-W01" max="2000-W52" /></dd>
<dt>week (with just min)</dt>
<dd><input type="week" name="myWeek6" min="1999-W01" /></dd>
<dt>week (with just max)</dt>
<dd><input type="week" name="myWeek7" max="2000-W12" /></dd>
<dt>week (with just step)</dt>
<dd><input type="week" name="myWeek8" step="3" /></dd>
<dt>week (with min, max, and step)</dt>
<dd><input type="week" name="myWeek9" min="1999-W01" max="2000-W52" step="3" /></dd>
<dt>week (with min and step)</dt>
<dd><input type="week" name="myWeek10" min="1999-W01" step="4" /></dd>
<dt>week (with max and step)</dt>
<dd><input type="week" name="myWeek11" max="2000-W52" step="4" /></dd>
<dt>week (with value, min, max, and step=any)</dt>
<dd><input type="week" name="myWeek12" value="2000-W26" min="2000-W01" max="2000-W52" step="any" /></dd>
<dt>week (with value, max, and step=any)</dt>
<dd><input type="week" name="myWeek13" value="2000-W26" max="2000-W52" step="any" /></dd>
<dt>week (with value, min, and step=any)</dt>
<dd><input type="week" name="myWeek14" value="2000-W26" min="2000-W01" step="any" /></dd>
<dt>week (with max and step=any)</dt>
<dd><input type="week" name="myWeek15" max="2000-W52" step="any" /></dd>
<dt>week (with min and step=any)</dt>
<dd><input type="week" name="myWeek16" min="2000-W01" step="any" /></dd>
<dt>week (with step=any)</dt>
<dd><input type="week" name="myWeek17" step="any" /></dd>
<dt>week (without anything)</dt>
<dd><input type="week" name="myWeek18" /></dd>
</dl>
<input type="submit" />
</form>
<a href="https://github.com/jonstipe/week-polyfill">Back to GitHub repo</a>
</body>
</html>