Skip to content

Instantly share code, notes, and snippets.

@patrickwelker
Created September 18, 2012 13:09
Show Gist options
  • Save patrickwelker/3743007 to your computer and use it in GitHub Desktop.
Save patrickwelker/3743007 to your computer and use it in GitHub Desktop.
Localized date via replace in Jekyll (Example: German)
<time datetime="{{ post.date | %Y-%m-%d %H:%M+01:00 }}">
{{ post.date | date: "%d. %B %Y" | replace:"January","Januar" | replace:"Februar","February" | replace:"March","März" | replace:"May","Mai" | replace:"June","Juni" | replace:"July","Juli" | replace:"December","Dezember" }}
</time>
@jumanji27
Copy link

great!

@nathraQ
Copy link

nathraQ commented May 5, 2014

+1 fast and easy way

@kleinmat
Copy link

you mixed up with february:

original:

replace:"Februar","February"

corrected :

replace:"February","Februar"

anyway +1 thanks

@michelgotta
Copy link

Oktober is missing, add:

replace:"October","Oktober"

@nextlevelshit
Copy link

nextlevelshit commented Jan 3, 2017

Isn't there any possibility to change the language by default? Something like setlocale(LC_TIME, "de_DE"); in PHP ... Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment