| Tests for .valueAsDate with <input type=date>. |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS valueAsDateFor("") is null |
| PASS valueAsDateFor("1969-12-31").getTime() is Date.UTC(1969, 11, 31) |
| PASS valueAsDateFor("1970-01-01").getTime() is Date.UTC(1970, 0, 1) |
| PASS valueAsDateFor("2009-12-22").getTime() is Date.UTC(2009, 11, 22) |
| PASS setValueAsDateAndGetValue(1969, 11, 1) is "1969-12-01" |
| PASS setValueAsDateAndGetValue(1970, 0, 1) is "1970-01-01" |
| PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12-31" |
| PASS setValueAsDateAndGetValue(10000, 0, 1) is "10000-01-01" |
| PASS setValueAsDateAndGetValue(-1, 0, 1) is "" |
| PASS setValueAsDateAndGetValue(0, 11, 31) is "" |
| PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-01-01" |
| PASS setValueAsDateAndGetValue(1582, 9, 15) is "1582-10-15" |
| PASS setValueAsDateAndGetValue(1582, 9, 31) is "1582-10-31" |
| PASS setValueAsDateAndGetValue(275760, 8, 13) is "275760-09-13" |
| PASS setValueAsDateAndGetValue(275760, 8, 14) is "" |
| Invalid objects: |
| PASS input.value = "2010-01-01"; input.valueAsDate = document; input.value is "" |
| PASS input.value = "2010-01-01"; input.valueAsDate = null; input.value is "" |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |