interval.count()

interval.count(start, end)

Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive). Note that this behavior is slightly different than interval.range because its purpose is to return the zero-based number of the specified end date relative to the specified start date. For example, to compute the current zero-based day-of-year number:

var now = new Date;
d3.timeDay.count(d3.timeYear(now), now); // 177

Likewise, to compute the current zero-based week-of-year number for weeks that start on Sunday:

d3.timeSunday.count(d3.timeYear(now), now); // 25
doc_D3_Js
2016-11-24 10:27:53
Comments
Leave a Comment

Please login to continue.