Skip to content

Instantly share code, notes, and snippets.

@andormade
Last active August 26, 2016 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andormade/04fdcdeda585e97162ec558677ec5c01 to your computer and use it in GitHub Desktop.
Save andormade/04fdcdeda585e97162ec558677ec5c01 to your computer and use it in GitHub Desktop.
It does Hungarian date format for Liquid templates
{% comment %}
Usage: {% include hungariandate.liquid date=post.date %}
or: {% include hungariandate.liquid date=page.date %}
2016 Andor Polgar (andor.cool)
{% endcomment %}
{{ include.date | date: "%Y." }}
{% assign m = include.date | date: "%-m" %}
{% case m %}
{% when '1' %} január
{% when '2' %} február
{% when '3' %} március
{% when '4' %} április
{% when '5' %} május
{% when '6' %} június
{% when '7' %} július
{% when '8' %} augusztus
{% when '9' %} szeptember
{% when '10' %} október
{% when '11' %} november
{% when '12' %} december
{% endcase %}
{{ include.date | date: "%-d." }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment