I can't figure out what I'm doing wrong, but trying to convert single digit months to their name representations (ex. '4' to 'April' in English) but am just getting December printed out for every single one. I can't compare to month names because the site is in quite a few languages, so need to actually use the date functionality.
{% set groupedEntries = entriesInYear | group("postDate|date('n')") %}
{% for key, eachMonth in groupedEntries %}
{% set monthName = date(key) | date('F') %}
<li>
<a href="{{ craft.languageLink.url(craft.locale, urlParam) }}"
{{ monthName }}, {{ eachMonth|length }}
</a>
</li>
{% endfor %}
'Key' is the month representation with no leading 0's (4, 3, and 2 for posts that exist in April, March and February).
Getting output as: December, 4 December, 4 December, 2 (following number is number of posts in that month)
WHAT the heck am I doing wrong?