-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-weeks.js
More file actions
34 lines (26 loc) · 1.3 KB
/
Copy pathtest-weeks.js
File metadata and controls
34 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require("./../../lib/env-js/envjs/node");
require("./../../d3");
require("./../../d3.time");
function parse(string) { return new Date(string); }
function format(date) { return date.toString(); }
console.log("weeks(2010-12-21T06:00:00Z, 2011-01-12T10:00:00Z):");
d3.time.weeks(parse("2010-12-21T06:00:00Z"), parse("2011-01-12T10:00:00Z")).forEach(log);
console.log("");
console.log("weeks(2011-03-02T07:00:00Z, 2011-03-24T11:00:00Z):");
d3.time.weeks(parse("2011-03-02T07:00:00Z"), parse("2011-03-24T11:00:00Z")).forEach(log);
console.log("");
console.log("weeks(2011-10-25T07:00:00Z, 2011-11-17T11:00:00Z):");
d3.time.weeks(parse("2011-10-25T07:00:00Z"), parse("2011-11-17T11:00:00Z")).forEach(log);
console.log("");
console.log("weeks(2011-10-25T07:00:00Z, 2012-11-17T11:00:00Z, 4):");
d3.time.weeks(parse("2011-10-25T07:00:00Z"), parse("2012-11-17T11:00:00Z"), 4).forEach(log);
console.log("");
console.log("weeks.utc(2010-12-20T22:00:00Z, 2011-01-12T02:00:00Z):");
d3.time.weeks.utc(parse("2010-12-20T22:00:00Z"), parse("2011-01-12T02:00:00Z")).forEach(log);
console.log("");
console.log("weeks.utc(2010-12-20T22:00:00Z, 2011-01-12T02:00:00Z, 4):");
d3.time.weeks.utc(parse("2010-12-20T22:00:00Z"), parse("2012-01-12T02:00:00Z"), 4).forEach(log);
console.log("");
function log(date) {
console.log(" " + format(date));
}