source:
Dev/trunk/d3/src/time/hour.js
@
76
Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago | |
---|---|
File size: 227 bytes |
Rev | Line | |
---|---|---|
[76] | 1 | d3.time.hour = function(date) { |
2 | var offset = date.getTimezoneOffset() / 60; | |
3 | return new Date((~~(date / 36e5 - offset) + offset) * 36e5); | |
4 | }; | |
5 | ||
6 | d3.time.hour.utc = function(date) { | |
7 | return new Date(~~(date / 36e5) * 36e5); | |
8 | }; |
Note: See TracBrowser
for help on using the repository browser.