source:
Dev/trunk/d3/src/time/week.js
@
76
Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago | |
---|---|
File size: 258 bytes |
Line | |
---|---|
1 | d3.time.week = function(date) { |
2 | (date = d3.time.day(date)).setDate(date.getDate() - date.getDay()); |
3 | return date; |
4 | }; |
5 | |
6 | d3.time.week.utc = function(date) { |
7 | (date = d3.time.day.utc(date)).setUTCDate(date.getUTCDate() - date.getUTCDay()); |
8 | return date; |
9 | }; |
Note: See TracBrowser
for help on using the repository browser.