~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/d3/src/time/day.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
d3.time.day = d3_time_interval(function(date) {
2
 
  return new d3_time(date.getFullYear(), date.getMonth(), date.getDate());
3
 
}, function(date, offset) {
4
 
  date.setDate(date.getDate() + offset);
5
 
}, function(date) {
6
 
  return date.getDate() - 1;
7
 
});
8
 
 
9
 
d3.time.days = d3.time.day.range;
10
 
d3.time.days.utc = d3.time.day.utc.range;
11
 
 
12
 
d3.time.dayOfYear = function(date) {
13
 
  var year = d3.time.year(date);
14
 
  return Math.floor((date - year) / 864e5 - (date.getTimezoneOffset() - year.getTimezoneOffset()) / 1440);
15
 
};