[76] | 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("months(2010-11-21T06:00:00Z, 2011-02-12T10:00:00Z):"); |
---|
| 9 | d3.time.months(parse("2010-11-21T06:00:00Z"), parse("2011-02-12T10:00:00Z")).forEach(log); |
---|
| 10 | console.log(""); |
---|
| 11 | |
---|
| 12 | console.log("months(2011-01-02T07:00:00Z, 2011-04-24T11:00:00Z):"); |
---|
| 13 | d3.time.months(parse("2011-01-02T07:00:00Z"), parse("2011-04-24T11:00:00Z")).forEach(log); |
---|
| 14 | console.log(""); |
---|
| 15 | |
---|
| 16 | console.log("months(2011-09-25T07:00:00Z, 2011-12-17T11:00:00Z):"); |
---|
| 17 | d3.time.months(parse("2011-09-25T07:00:00Z"), parse("2011-12-17T11:00:00Z")).forEach(log); |
---|
| 18 | console.log(""); |
---|
| 19 | |
---|
| 20 | console.log("months(2011-09-25T07:00:00Z, 2012-12-17T11:00:00Z, 3):"); |
---|
| 21 | d3.time.months(parse("2011-09-25T07:00:00Z"), parse("2012-12-17T11:00:00Z"), 3).forEach(log); |
---|
| 22 | console.log(""); |
---|
| 23 | |
---|
| 24 | console.log("months.utc(2010-11-20T22:00:00Z, 2011-02-12T02:00:00Z):"); |
---|
| 25 | d3.time.months.utc(parse("2010-11-20T22:00:00Z"), parse("2011-02-12T02:00:00Z")).forEach(log); |
---|
| 26 | console.log(""); |
---|
| 27 | |
---|
| 28 | console.log("months.utc(2010-11-20T22:00:00Z, 2012-02-12T02:00:00Z, 3):"); |
---|
| 29 | d3.time.months.utc(parse("2010-11-20T22:00:00Z"), parse("2012-02-12T02:00:00Z"), 3).forEach(log); |
---|
| 30 | console.log(""); |
---|
| 31 | |
---|
| 32 | function log(date) { |
---|
| 33 | console.log(" " + format(date)); |
---|
| 34 | } |
---|