blob: f426ecc7144a3fc4a9398793061a6e224adb3671 [file] [log] [blame]
Tests for .valueAsDate with <input type=month>.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS valueAsDateFor("") is null
PASS valueAsDateFor("1969-12").getTime() is Date.UTC(1969, 11, 1, 0, 0, 0, 0)
PASS valueAsDateFor("1970-01").getTime() is Date.UTC(1970, 0, 1)
PASS valueAsDateFor("2009-12").getTime() is Date.UTC(2009, 11, 1)
PASS setValueAsDateAndGetValue(1969, 11, 1) is "1969-12"
PASS setValueAsDateAndGetValue(1970, 0, 1) is "1970-01"
PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12"
PASS setValueAsDateAndGetValue(10000, 0, 1) is "10000-01"
PASS setValueAsDateAndGetValue(-1, 9, 22) is ""
PASS setValueAsDateAndGetValue(0, 11, 30) is ""
PASS setValueAsDateAndGetValue(0001, 0, 1) is "0001-01"
PASS setValueAsDateAndGetValue(0001, 0, 31) is "0001-01"
PASS setValueAsDateAndGetValue(275760, 8, 13) is "275760-09"
PASS setValueAsDateAndGetValue(275760, 8, 14) is ""
Sets null to valueAsDate:
PASS input.value is ""
PASS successfullyParsed is true
TEST COMPLETE