I'm using the technique for creating an archive that's in the Craft docs: https://craftcms.com/support/entry-archive
I'm archiving by day, so my code looks like this:
{% set agendaEntries = craft.entries.section('agenda').status('live,pending,expired').limit(null) %}
{% for day, entriesInDay in agendaEntries | group('postDate.day') %}
<h2>{{ day | date('Y-m-d') }}</h2>
<ul>
{% for entry in entriesInDay %}
<li>
{# entry data #}
</li>
{% endfor %}
</ul>
{% endfor %}
The looping and grouping (heh) works great, but the {{ day }}
variable doesn't correctly output the date, instead I get the day-before-Epoch date (1969-12-31).
I don't really understand how the for
loop even knows what the day
variable is, so I don't know how to troubleshoot.