Skip to content
Snippets Groups Projects
Unverified Commit b7ab7309 authored by Tom Wiesing's avatar Tom Wiesing
Browse files

Proper date formatting

parent 5926a345
No related branches found
No related tags found
No related merge requests found
{% comment %}
Properly formats the date in yyyy[-mm] format.
Expects 'date' to be formatted as an argument.
{% endcomment %}
{% assign dateparts = date | split: "-" %}
{% assign year = dateparts[0] %}
{% assign month = dateparts[1] %}
{% if month == '01' %}
January
{% elsif month == '02' %}
February
{% elsif month == '03' %}
March
{% elsif month == '04' %}
April
{% elsif month == '05' %}
May
{% elsif month == '06' %}
June
{% elsif month == '07' %}
July
{% elsif month == '08' %}
August
{% elsif month == '09' %}
September
{% elsif month == '10' %}
October
{% elsif month == '11' %}
November
{% elsif month == '12' %}
December
{% endif %}
{{year}}
\ No newline at end of file
......@@ -15,10 +15,16 @@
<a href="{{person.url}}" class="title">{{person.fullname}}</a>
<p>
{% if person.start_date %}
from {{person.start_date}} <br/>
from
{% assign date = person.start_date %}
{% include date.html %}
<br/>
{% endif %}
{% if person.end_date %}
until {{person.end_date}} <br/>
until
{% assign date = person.end_date %}
{% include date.html %}
<br/>
{% endif %}
</p>
</li>
......
......@@ -13,12 +13,18 @@
<li class="collection-item avatar">
<a href="{{project.url}}" class="title">{{project.fullname}}</a>
<p>
{% if project.start_date %}
from {{project.start_date}} <br/>
{% endif %}
{% if project.end_date %}
until {{project.end_date}} <br/>
{% endif %}
{% if project.start_date %}
from
{% assign date = project.start_date %}
{% include date.html %}
<br/>
{% endif %}
{% if project.end_date %}
until
{% assign date = project.end_date %}
{% include date.html %}
<br/>
{% endif %}
</p>
</li>
{% endfor %}
......
......@@ -18,7 +18,15 @@ layout: default
{% if page.start %}
<p>
<b>From:</b> {{page.start}} {% if page.end %} <b>To:</b> {{page.end}} {% endif %}
<b>From:</b>
{% assign date = page.start %}
{% include date.html %}
{% if page.end %}
<b>To:</b>
{% assign date = page.end %}
{% include date.html %}
{% endif %}
</p>
{% endif %}
......
......@@ -17,7 +17,15 @@ layout: default
{% if page.start %}
<p>
<b>From:</b> {{page.start}} {% if page.end %} <b>To:</b> {{page.end}} {% endif %}
<b>From:</b>
{% assign date = page.start %}
{% include date.html %}
{% if page.end %}
<b>To:</b>
{% assign date = page.end %}
{% include date.html %}
{% endif %}
</p>
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment