-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-hours.js
More file actions
34 lines (26 loc) · 1.3 KB
/
Copy pathtest-hours.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("hours(2011-01-01T06:00:00Z, 2011-01-01T10:00:00Z):");
d3.time.hours(parse("2011-01-01T06:00:00Z"), parse("2011-01-01T10:00:00Z")).forEach(log);
console.log("");
console.log("hours(2011-03-13T07:00:00Z, 2011-03-13T11:00:00Z):");
d3.time.hours(parse("2011-03-13T07:00:00Z"), parse("2011-03-13T11:00:00Z")).forEach(log);
console.log("");
console.log("hours(2011-11-06T07:00:00Z, 2011-11-06T11:00:00Z):");
d3.time.hours(parse("2011-11-06T07:00:00Z"), parse("2011-11-06T11:00:00Z")).forEach(log);
console.log("");
console.log("hours(2011-11-06T07:00:00Z, 2011-11-07T11:00:00Z, 3):");
d3.time.hours(parse("2011-11-06T07:00:00Z"), parse("2011-11-07T11:00:00Z"), 3).forEach(log);
console.log("");
console.log("hours.utc(2010-12-31T22:00:00Z, 2011-01-01T02:00:00Z):");
d3.time.hours.utc(parse("2010-12-31T22:00:00Z"), parse("2011-01-01T02:00:00Z")).forEach(log);
console.log("");
console.log("hours.utc(2010-12-31T22:00:00Z, 2011-01-02T02:00:00Z, 3):");
d3.time.hours.utc(parse("2010-12-31T22:00:00Z"), parse("2011-01-02T02:00:00Z"), 3).forEach(log);
console.log("");
function log(date) {
console.log(" " + format(date));
}