Fix off-by-one dates on provider history

We chunk history entries by their YYYY-MM-DD date representation to
display them day-by-day.

However trying to convert a YYYY-MM-DD string into a timestamp is
unpredictable, and was causing our dates to be one day out (probably
because of midnight/daylight savings/general datetime horrors).

This commit changes the code to do the same thing as the history page,
which is look at the `updated_at` field on the first entry to get a
datetime object and from that the formatted date we show in the headings
on the page.
This commit is contained in:
Chris Hill-Scott
2019-12-13 12:24:19 +00:00
parent 1e233f1167
commit 581296b95e
2 changed files with 5 additions and 3 deletions

View File

@@ -51,7 +51,7 @@
{% for day, versions in versions %}
<h2 class="heading-small top-gutter">
{% if day %}
{{ day|format_date_human|title }}
{{ versions[0]['updated_at']|format_date_human|title }}
{% else %}
Start
{% endif %}