Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1.  
  2. var d3_time_scaleLocalFormat = d3.time.format.multi([
  3. [".%L", function(d) { return d.getMilliseconds(); }],
  4. [":%S", function(d) { return d.getSeconds(); }],
  5. ["%I:%M", function(d) { return d.getMinutes(); }],
  6. ["%I %p", function(d) { return d.getHours(); }],
  7. ["%a %d", function(d) { return d.getDay() && d.getDate() != 1; }],
  8. ["%b %d", function(d) { return d.getDate() != 1; }],
  9. ["%B", function(d) { return d.getMonth(); }],
  10. ["%Y", function() {return true; }]
  11. ]);
  12.  
  13. console output:
  14.  
  15. (new Date()).getDay()
  16. 4
  17. d3.time.year(new Date())
  18. Date 2015-01-01T06:00:00.000Z
  19. d3_time_scaleLocalFormat().d3.time.year(new Date())
  20. TypeError: d is undefined
  21. d3_time_scaleLocalFormat.d3.time.year(new Date())
  22. TypeError: d3_time_scaleLocalFormat.d3 is undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement