Skip to content

Instantly share code, notes, and snippets.

@HendrikPetertje
Created February 25, 2015 21:23
Show Gist options
  • Save HendrikPetertje/3921c07e45e6ae3190e3 to your computer and use it in GitHub Desktop.
Save HendrikPetertje/3921c07e45e6ae3190e3 to your computer and use it in GitHub Desktop.
# Search strftime on google to find time formats and default day month etc annotation
en:
# (or sv: whatever)
time:
formats:
short: "%A %e %B"
time: "%H:%M"
default: "%d/%m/%Y %H:%M"
small: '%a %d %B'
date:
day_names: [Zondag, Maandag, Dinsdag, Woensdag, Donderdag, Vrijdag, Zaterdag]
month_names: [~, januari, februari, maart, april, mei, juni, juli, augustus, september, oktober, november, december]
defaullt: "%d/%m/%Y %H:%M"
abbr_day_names: [Zo, Ma, Di, Wo, Do, Vr, Za]
Then in your views do:
<%= = l @article.date, format: :short # Where :short matches the time format you want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment