-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-hours.js
More file actions
26 lines (20 loc) · 964 Bytes
/
Copy pathtest-hours.js
File metadata and controls
26 lines (20 loc) · 964 Bytes
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
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.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("");
function log(date) {
console.log(" " + format(date));
}