1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Use new date adjustment technique

This commit is contained in:
Robert Krimen
2012-10-07 22:54:39 -07:00
parent e35b7985f6
commit fa0f2abc44
4 changed files with 82 additions and 114 deletions

View File

@@ -579,6 +579,7 @@ func TestDate(t *testing.T) {
test(`new Date(2009, 9, 25).toString()`, "Sun, 25 Oct 2009 00:00:00 UTC")
test(`+(new Date(2009, 9, 25))`, "1.2564288e+12")
test(`abc = new Date(12564504e5); abc.setMilliseconds(2001); abc.toString()`, "Sun, 25 Oct 2009 06:00:02 UTC")
test(`abc = new Date(12564504e5); abc.setMonth(9); abc.toString()`, "Sun, 25 Oct 2009 06:00:00 UTC")
test(`abc = new Date(12564504e5); abc.setMonth("09"); abc.toString()`, "Sun, 25 Oct 2009 06:00:00 UTC")
test(`abc = new Date(12564504e5); abc.setMonth("10"); abc.toString()`, "Wed, 25 Nov 2009 07:00:00 UTC")