{% for d in dates reversed %} {% ifchanged d|date:"Y" %} {% if not forloop.first %}
{% endifchanged %} {{ d|date:"F" }} {% endfor %}