blob: c970b1c7627b5069f8e47cb61fd6693752df4be9 [file] [log] [blame]
Tests for .valueAsDate with <input type=time>.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS valueAsDateFor("") is null
PASS valueAsDateFor("00:00:00.000").getTime() is Date.UTC(1970, 0, 1, 0, 0, 0, 0)
PASS valueAsDateFor("04:35").getTime() is Date.UTC(1970, 0, 1, 4, 35, 0, 0)
PASS valueAsDateFor("23:59:59.999").getTime() is Date.UTC(1970, 0, 1, 23, 59, 59, 999)
PASS setValueAsDateAndGetValue(0, 0, 0, 0) is "00:00"
PASS setValueAsDateAndGetValue(0, 0, 1, 0) is "00:00:01"
PASS setValueAsDateAndGetValue(0, 0, 0, 2) is "00:00:00.002"
PASS setValueAsDateAndGetValue(11, 59, 59, 999) is "11:59:59.999"
PASS setValueAsDateAndGetValue(12, 0, 0, 0) is "12:00"
PASS setValueAsDateAndGetValue(23, 59, 59, 999) is "23:59:59.999"
PASS setValueAsDateAndGetValue(24, 0, 0, 0) is "00:00"
PASS setValueAsDateAndGetValue(48, 0, 13, 0) is "00:00:13"
PASS setValueAsDateAndGetValue(-23, -59, -59, 0) is "00:00:01"
Invalid Date:
PASS var date = new Date(); date.setTime(8.65E15); input.valueAsDate = date; input.value is ""
Invalid objects:
PASS input.value = "00:00"; input.valueAsDate = document; input.value is ""
PASS input.value = "00:00"; input.valueAsDate = null; input.value is ""
Step attribute value and string representation:
PASS input.step = "1"; setValueAsDateAndGetValue(0, 0, 0, 0) is "00:00:00"
PASS input.step = "0.001"; setValueAsDateAndGetValue(0, 0, 0, 0) is "00:00:00.000"
PASS successfullyParsed is true
TEST COMPLETE