forked from apleshkov/DateTimePicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
108 lines (98 loc) · 3.49 KB
/
test.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
101
102
103
104
105
106
107
108
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DateTimeField</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- ExtJS -->
<link type="text/css" rel="stylesheet" href="ext-3.3.1/resources/css/ext-all.css"/>
<script type="text/javascript" src="ext-3.3.1/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="ext-3.3.1/ext-all-debug.js"></script>
<!-- /ExtJS -->
<link type="text/css" rel="stylesheet" href="build/date-time-ux.css"/>
<script type="text/javascript" src="build/date-time-ux-debug.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
Ext.onReady(function () {
var dateField = new Ext.ux.form.DateTimeField({
dateFormat: 'j M Y',
timeFormat: Ext.ux.ExBaseTimePicker.prototype.format,
fieldLabel: 'Date & time',
picker: {
timePicker: new Ext.ux.ExBaseTimePicker({
hourIncrement: 1,
minIncrement: 35
})
}
});
var form = new Ext.form.FormPanel({
title: 'My form',
bodyStyle: {
padding: '10px'
},
items: [dateField],
buttons: [
new Ext.Button({
text: 'Show DateMenu',
menu: {
xtype: 'datetimemenu',
picker: {
timePicker: {
xtype: 'exbasetimepicker'
},
timeFormat: 'H:i:s'
}
}
})
]
});
new Ext.Panel({
title: 'Test',
renderTo: Ext.getBody(),
width: 800,
height: 400,
bodyStyle: {
padding: '10px'
},
layout: 'absolute',
items: [
{
x: 10,
y: 10,
border: false,
items: form,
width: 500
},
{
xtype: 'datetimepicker',
x: 600,
y: 10,
timeFormat: 'H:i',
timePicker: {
hourIncrement: 1,
minIncrement: 45
}
}
],
buttons: [
{
text: 'Set current time',
handler: function (df) {
df.setValue(new Date());
}.createDelegate(this, [dateField], 0)
},
{
text: 'Destroy form',
handler: function (f) {
Ext.destroy(f);
}.createDelegate(this, [form], 0)
}
]
});
});
/*]]>*/
</script>
</head>
<body>
</body>
</html>