Get a query range appropriate for a given aggregate level.
Returns an object with start and end Date properties, using the given endDate
parameter as the basis for calculating the start as an offset backwards in time
based on the given aggregate level.
The aggregateTimeCount will be treated as a "next higher" aggregate level from
aggregate, like this:
< Hour: numHours
Hour : numDays
Day : numMonths
Month : numYears
For example, you might like to render a chart using TenMinute aggregate data for the
last 24 hours. You'd call this function like this:
Get a query range appropriate for a given aggregate level.
Returns an object with
start
andend
Date properties, using the givenendDate
parameter as the basis for calculating the start as an offset backwards in time based on the givenaggregate
level.The
aggregateTimeCount
will be treated as a "next higher" aggregate level fromaggregate
, like this:Hour
:numHours
Hour
:numDays
Day
:numMonths
Month
:numYears
For example, you might like to render a chart using
TenMinute
aggregate data for the last 24 hours. You'd call this function like this: