A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
An offset function which takes a date and an integer step as arguments and advances the specified date by the specified number of boundaries; the step may be positive, negative or zero.
Constructs a new custom interval given the specified floor, offset and count functions.
The returned custom interval is countable and exposes the methods "count(..)" and "every(...)".
Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
An offset function which takes a date and an integer step as arguments and advances the specified date by the specified number of boundaries; the step may be positive, negative or zero.
A count function which takes a start date and an end date, already floored to the current interval, and returns the number of boundaries between the start (exclusive) and end (inclusive). Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
Optional
field: ((date) => number)An optional field function which takes a date, already floored to the current interval, and returns the field value of the specified date, corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary. For example, for the timeDay interval, this returns the number of days since the start of the month. If a field function is not specified, it defaults to counting the number of interval boundaries since the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every.
Constructs a new custom interval given the specified floor and offset functions.
The returned custom interval is not countable, i.e. does not expose the methods "count(..)" and "every(...)".