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

Implement Date.setMonth/setUTCMonth

This commit is contained in:
Robert Krimen
2012-10-07 19:16:58 -07:00
parent d908ab1a55
commit e35b7985f6
3 changed files with 53 additions and 3 deletions

View File

@@ -578,6 +578,10 @@ func TestDate(t *testing.T) {
test(`new Date(12564504e5).toString()`, "Sun, 25 Oct 2009 06:00:00 UTC")
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.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")
}
func TestComparison(t *testing.T) {