1 | require("./../../lib/env-js/envjs/node"); |
---|
2 | require("./../../d3"); |
---|
3 | require("./../../d3.time"); |
---|
4 | |
---|
5 | var formats = [ |
---|
6 | "a", "A", "b", "B", "c", "d", "e", "H", "I", "j", "m", "M", |
---|
7 | "p", "S", "U", "w", "W", "x", "X", "y", "Y", "Z", "%" |
---|
8 | ]; |
---|
9 | |
---|
10 | var now = new Date(1990, 0, 1); |
---|
11 | console.log("format 01/01/1990 00:00:00:"); |
---|
12 | formats.forEach(function(f) { |
---|
13 | console.log(" " + f + ":", d3.time.format("%" + f)(now)); |
---|
14 | }); |
---|
15 | console.log(""); |
---|
16 | |
---|
17 | var now = new Date(2011, 11, 31, 23, 59, 59); |
---|
18 | console.log("format 12/31/2011 23:59:59:"); |
---|
19 | formats.forEach(function(f) { |
---|
20 | console.log(" " + f + ":", d3.time.format("%" + f)(now)); |
---|
21 | }); |
---|
22 | console.log(""); |
---|