Convert Month Number to Month Name

Problem

You have a month number (04), and you want the month name (April).

Solution

{% macro monthNameFromNumber(monthNumber) %}
    {# monthNumber will be 00-12. we use that to construct a date string, convert it to date and then pick the month name out of that #}
    {{ date('2014-' ~ monthNumber ~ '-01') | date('F') }}
{% endmacro %}