source: Dev/trunk/d3/test/time/test-month.js @ 76

Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago

d3

File size: 1.3 KB
Line 
1require("./../../lib/env-js/envjs/node");
2require("./../../d3");
3require("./../../d3.time");
4
5function parse(string) { return new Date(string); }
6function format(date) { return date.toString(); }
7
8console.log("month:");
9console.log("  2011-01-01T07:59:59Z -> " + format(d3.time.month(parse("2011-01-01T07:59:59Z"))));
10console.log("  2011-01-01T08:00:00Z -> " + format(d3.time.month(parse("2011-01-01T08:00:00Z"))));
11console.log("  2011-01-01T08:00:01Z -> " + format(d3.time.month(parse("2011-01-01T08:00:01Z"))));
12console.log("  2011-03-13T09:00:00Z -> " + format(d3.time.month(parse("2011-03-13T09:00:00Z"))));
13console.log("  2011-11-06T09:00:00Z -> " + format(d3.time.month(parse("2011-11-06T09:00:00Z"))));
14console.log("");
15
16console.log("month.utc:");
17console.log("  2010-12-31T23:59:59Z -> " + format(d3.time.month.utc(parse("2010-12-31T23:59:59Z"))));
18console.log("  2011-01-01T00:00:00Z -> " + format(d3.time.month.utc(parse("2011-01-01T00:00:00Z"))));
19console.log("  2011-01-01T23:00:00Z -> " + format(d3.time.month.utc(parse("2011-01-01T23:00:00Z"))));
20console.log("  2011-03-13T09:00:00Z -> " + format(d3.time.month.utc(parse("2011-03-13T09:00:00Z"))));
21console.log("  2011-11-06T09:00:00Z -> " + format(d3.time.month.utc(parse("2011-11-06T09:00:00Z"))));
22console.log("");
Note: See TracBrowser for help on using the repository browser.