1 Tests for .valueAsDate with <input type=week>.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 PASS valueAsDateFor("") is null
7 PASS valueAsDateFor("2007-W01").getTime() is Date.UTC(2007, 0, 1)
8 PASS valueAsDateFor("2008-W01").getTime() is Date.UTC(2007, 11, 31)
9 PASS valueAsDateFor("2003-W01").getTime() is Date.UTC(2002, 11, 30)
10 PASS valueAsDateFor("2004-W01").getTime() is Date.UTC(2003, 11, 29, 0, 0, 0, 0)
11 PASS valueAsDateFor("2010-W01").getTime() is Date.UTC(2010, 0, 4)
12 PASS valueAsDateFor("2005-W01").getTime() is Date.UTC(2005, 0, 3)
13 PASS valueAsDateFor("2006-W01").getTime() is Date.UTC(2006, 0, 2)
15 PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-W01"
16 PASS setValueAsDateAndGetValue(2007, 0, 1) is "2007-W01"
17 PASS setValueAsDateAndGetValue(2008, 0, 1) is "2008-W01"
18 PASS setValueAsDateAndGetValue(2003, 0, 1) is "2003-W01"
19 PASS setValueAsDateAndGetValue(2004, 0, 1) is "2004-W01"
20 PASS setValueAsDateAndGetValue(2010, 0, 1) is "2009-W53"
21 PASS setValueAsDateAndGetValue(2005, 0, 1) is "2004-W53"
22 PASS setValueAsDateAndGetValue(2006, 0, 1) is "2005-W52"
24 PASS setValueAsDateAndGetValue(2010, 0, 3) is "2009-W53"
25 PASS setValueAsDateAndGetValue(2010, 0, 4) is "2010-W01"
26 PASS setValueAsDateAndGetValue(2010, 0, 10) is "2010-W01"
27 PASS setValueAsDateAndGetValue(2010, 0, 11) is "2010-W02"
28 PASS setValueAsDateAndGetValue(2010, 0, 17) is "2010-W02"
29 PASS setValueAsDateAndGetValue(2010, 11, 31) is "2010-W52"
30 Around the minimum value:
31 PASS setValueAsDateAndGetValue(0, 11, 31) is ""
32 PASS setValueAsDateAndGetValue(0, 0, 1) is ""
33 PASS successfullyParsed is true