Monday, 15 March 2010

jekyll - Converting military to standard time -



jekyll - Converting military to standard time -

i need display next jekyll front-matter in 2 different formats: armed forces format js library , standard format display. seems way more complicated should be. ideas? i'm open changing format of yaml if there's improve way specify it.

--- layout: event title: big air trampoline park field trip start: "13:00" end: "15:00"

i ended creating include this, suggest improve approach:

{% assign times = include.param | split: ':' %} {% assign h = times[0] | modulo:12 %} {% assign hh = times[0] | modulo:24 %} {% if h == 0 %}12{% else %}{{h}}{% endif %}:{{times[1]}} {% if h == hh %}am{% else %}pm{% endif %}

i phone call this:

{% include display_time.html param=event.start %}

jekyll liquid

No comments:

Post a Comment