forked from jcgertig/date-input-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (48 loc) · 1.49 KB
/
index.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
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<meta charset="UTF-8">
<title>Polyfill Test</title>
<meta name="description" content="Polyfill Test">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
</head>
<body style="width: 200%; height: 200%;">
<p>
normal:
<input type="date" />
<script>
var theDate = document.querySelector('input[type="date"]');
theDate.addEventListener('change', function() {
console.log('blank date input:', theDate.value);
});
</script>
</p>
<p>
with value:
<input type="date" value="2015-03-28" lang="test" />
</p>
<p>
with format ("date-format"):
<input type="date" lang="test" date-format="mm/dd/yyyy" />
</p>
<p>
with format ("data-date-format"):
<input type="date" lang="test" data-date-format="mm/dd/yyyy" />
</p>
<p>
text class with format:
<input class="date-polyfill" type="text" lang="test" date-format="mm/dd/yyyy" />
</p>
<p id="dynamic" style="margin-top: 25%; margin-left: 25%;">
dynamically created:
<script>
setTimeout(function() {
var input = document.createElement("input");
input.setAttribute("type", "date");
document.getElementById("dynamic").appendChild(input);
}, 2000);
</script>
</p>
<script src="date-input-polyfill.dist.js"></script>
</body>
</html>