-
Notifications
You must be signed in to change notification settings - Fork 10
/
demo.html
100 lines (81 loc) · 4.54 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 Datetime-local 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="datetime-local-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="datetime-local-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: 'datetime-local',
name: 'generatedElement',
value: '2000-07-01T12:00',
min: '2000-01-03T00:00',
max: '2000-12-29T23:59'
});
ddElem.appendChild(inputElem);
$('dl').first().append(dtElem).append(ddElem);
$(inputElem).inputDateTimeLocal();
});
//]]>
</script>
</head>
<body>
<form id="form-demo">
<dl>
<dt>datetime-local (with value, min, and max)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal0" value="2000-07-01T12:00" min="2000-01-03T00:00" max="2000-12-29T23:59" /></dd>
<dt>datetime-local (with value and max)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal1" value="2000-07-01T12:00" max="2000-12-31T23:59" /></dd>
<dt>datetime-local (with value and min)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal2" value="2000-07-01T12:00" min="2000-01-01T00:00" /></dd>
<dt>datetime-local (with value and step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal3" value="2000-07-01T12:00" step="60" /></dd>
<dt>datetime-local (with value, min, max, and step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal4" value="2000-07-01T12:00" min="2000-01-01T00:00" max="2000-12-31T23:59" step="60" /></dd>
<dt>datetime-local (with min and max)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal5" min="2000-01-01T00:00" max="2000-12-31T23:59" /></dd>
<dt>datetime-local (with just min)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal6" min="2000-01-01T00:00" /></dd>
<dt>datetime-local (with just max)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal7" max="2000-12-31T23:59" /></dd>
<dt>datetime-local (with just step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal8" step="60" /></dd>
<dt>datetime-local (with min, max, and step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal9" min="2000-01-01T00:00" max="2000-12-31T23:59" step="60" /></dd>
<dt>datetime-local (with min and step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal10" min="2000-01-01T00:00" step="60" /></dd>
<dt>datetime-local (with max and step)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal11" max="2000-12-31T23:59" step="60" /></dd>
<dt>datetime-local (with value, min, max, and step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal12" value="2000-07-01T12:00" min="2000-01-01T00:00" max="2000-12-31T23:59" step="any" /></dd>
<dt>datetime-local (with value, max, and step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal13" value="2000-07-01T12:00" max="2000-12-31T23:59" step="any" /></dd>
<dt>datetime-local (with value, min, and step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal14" value="2000-07-01T12:00" min="2000-01-01T00:00" step="any" /></dd>
<dt>datetime-local (with max and step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal15" max="2000-12-31T23:59" step="any" /></dd>
<dt>datetime-local (with min and step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal16" min="2000-01-01T00:00" step="any" /></dd>
<dt>datetime-local (with step=any)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal17" step="any" /></dd>
<dt>datetime-local (without anything)</dt>
<dd><input type="datetime-local" name="myDateTimeLocal18" /></dd>
</dl>
<input type="submit" />
</form>
<a href="https://github.com/jonstipe/datetime-local-polyfill">Back to GitHub repo</a>
</body>
</html>