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