4 <script src=
"../../../resources/js-test.js"></script>
5 <script src=
"../resources/picker-common.js"></script>
6 <script src=
"resources/calendar-picker-common.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
10 <input type=
"datetime-local" id=
"datetime" value=
"2012-11-20T00:00" step=
"302400"/>
11 <input type=
"datetime-local" id=
"datetime-bare" step=
"302400"/>
14 description('Test if step limits available dates in calendar picker on datetime input.');
16 document
.getElementById('datetime-bare').value
= '2012-11-20T00:00';
17 openPicker(document
.getElementById('datetime-bare'), test1
);
20 debug("Step without value, min nor max attributes.");
21 shouldBeEqualToString('availableDayCells()', '2012-10-28,2012-11-01,2012-11-04,2012-11-08,2012-11-11,2012-11-15,2012-11-18,2012-11-22,2012-11-25,2012-11-29');
24 eventSender
.keyDown('escape');
25 waitUntilClosing(test1AfterClose
);
28 function test1AfterClose() {
29 openPicker(document
.getElementById('datetime'), test2
);
33 debug("Step without min or max.");
34 shouldBeEqualToString('availableDayCells()', '2012-10-30,2012-11-02,2012-11-06,2012-11-09,2012-11-13,2012-11-16,2012-11-20,2012-11-23,2012-11-27,2012-11-30');
37 eventSender
.keyDown('escape');
38 waitUntilClosing(test2AfterClose
);
41 function test2AfterClose() {
42 document
.getElementById('datetime').min
= '2012-11-16T12:00';
45 openPicker(document
.getElementById('datetime'), test3
);
49 debug("Step when min is set.");
50 shouldBeEqualToString('availableDayCells()', '2012-11-16,2012-11-20,2012-11-23,2012-11-27,2012-11-30');
53 eventSender
.keyDown('escape');
54 waitUntilClosing(test3AfterClose
);
57 function test3AfterClose() {
58 document
.getElementById('datetime').max
= '2012-11-20T00:00';
61 openPicker(document
.getElementById('datetime'), test4
);
65 debug("Step when min and max are set.");
66 shouldBeEqualToString('availableDayCells()', '2012-11-16,2012-11-20');