forked from kissyteam/date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
71 lines (65 loc) · 2.03 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
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<title>DatePicker</title>
<link href="/build/date-picker/assets/dpl.css" rel="stylesheet"/>
<script src="/mx_modules/modulex-debug.js"></script>
<script src="/mx_modules/ua-debug.js"></script>
<script src="/mx_modules/feature-debug.js"></script>
<script src="/mx_modules/meta.js"></script>
<script>
(function () {
var build = location.href.indexOf('?build') !== -1;
modulex.config({
base: '/mx_modules',
packages: {
'date-picker': {
filter: build ? 'debug' : '',
base: '/' + (build ? 'build' : 'lib') + '/date-picker'
}
}
});
})();
</script>
<style>
a:focus {
color: red;
}
</style>
</head>
<body>
<a id="prev" href="#">prev link</a>
<div id="holder">
</div>
<a id="next" href="#">next link</a>
<div id="result">
</div>
</body>
<script>
modulex.use('node,date-picker,gregorian-calendar-format', function (Node, DatePicker, DateFormat) {
var result = Node.all('#result');
var picker = new DatePicker({
disabledDate: function (current, value) {
return current.getMonth() < value.getMonth();
},
showWeekNumber: false,
showClear: false,
showToday: false,
render: '#holder'
}).render();
picker.on('select', function (e) {
var value = e.value;
if (value) {
result.html(DateFormat.getDateInstance(DateFormat.Style.FULL).format(value));
} else {
result.html('null');
}
});
});
</script>
</html>