alphagov/spotlight — pull request #315 by annapowellsmith (2014-03-27 16:59:03+00:00)
Title: Allow pinning to start or end date

Pivotal story: https://www.pivotaltracker.com/s/projects/911874/stories/63604218

We can now specify a start or end date for Spotlight graphs. This feature is required in order to archive the /deposit-foreign-marriage dashboard [1].

As a side benefit, it also allows us to show all available data on the G-Cloud dashboard, as specified by the original G-Cloud designs. And it also lets us show data from when the clocks changed on /no-realistic-dashboard, which is useful for debugging.

The logic works as follows:
* If both a start and end date are specified in config, we use them both.
* If a start date is specified but not an end date, we set the end date to now.
* If an end date is specified but not a start date, we set the start date by looking at the "period" parameter, and counting backwards by the specified number of periods. Note that this requires the "period" parameter to be set: we will need to ensure that this is set in Stagecraft DSL logic.

The following modules have been updated to include this feature: grouped_timeseries, completion, and availability.

The following modules have not been updated to include this feature: realtime, list, and user satisfaction (since these are currently list queries and don't support dates); multi_stats (no current requirement); and journey (also no current requirement, as agreed with Matt).

[1] https://www.pivotaltracker.com/s/projects/911874/stories/63389134