alphagov/datainsight-insidegov-recorder — pull request #12 by phss (2013-11-11 16:31:18+00:00)
Title: Fix bug on daylight saving

The weekly query returns about 27 datapoints, each a week for the last 6 months. We generate these datapoints based on the `start_at` of the earliest available entry, adding 7 days until we reach today. The generated dates are used as a lookup, which we query to fill in the values for that week.

6 months ago we were on daylight savings time, so the earliest `start_at` had a time component of 23:00:00. Therefore, all subsequent dates have the same time component since we are only adding days. After we left daylights saving time, the lookup failed. A query for `2013-11-03 00:00:00` found no date, but we had an entry for `2013-11-02 23:00:00`.

I've changed the lookup to use dates, not datetimes. We still validate that the data generated is at midnight and the period is a week.