Date Context
A date-range can be preloaded in the date context using the start
and end
parameters.
Both fields are optional. When not provided, a default will be provided by the widget, which will vary widget-by-widget.
Each parameter can be passed a number, which will be interpreted as a Unix epoch timestamp.
- This is the preferred way, as it will provide the most consistent results.
- A convenient tool to getting a timestamp is available at unixtime.org.
- Keep in mind that all timestamps operate on the Coordinated Universal Time (UTC) timezone.
- For example, for 10 AM EST 1/19/22 to 10 AM EST 1/20/22, one would provide
?context={"type":"DATE","id":"red","input":{"start":1642604400000,"end":1642690800000}}
Alternatively, each parameter can also be passed a string, and it will be interpreted by the JavaScript Date.parse() method.
- This should be avoided, as it can produce inconsistent results based on browser + timezone of the user (particularly if an ambiguous string is provided).
- The most consistent approach uses simplified ISO 8601 formatted dates
- For example, for 10 AM EST 1/19/22 to 10 AM EST 1/20/22, one would provide
?context={"type":"DATE","id":"red","input":{"start":"2022-01-19T15:00:00.000Z","end":"2022-01-20T15:00:00.000Z"}}
Relative Date Context can be used when you would like to set the date based on today and 'x' number of days in the past. The potential date ranges are:
Parameter | Relative Time Span |
---|---|
day |
last 24 hours |
three_days |
last three days |
week |
last seven days |
month |
last 30 days |
quarter |
last 90 days |
number | last number of milliseconds |
Set the context using the relativeSpan
parameter using the DATE
type as follows: ?context={"type":"DATE","id":"red","mergeType":"replace","input":{"relativeSpan":"three_days"}}
Home PowerIntell.AI™ Apollo Pro® RegLens®