More options for date format

Fixes #966
This commit is contained in:
Eric Allen 2009-12-16 17:54:29 -05:00
parent e17b495b95
commit 0eec884428

View file

@ -170,9 +170,13 @@ module ApplicationHelper
standard_format = current_user.prefs.date_format
translations = [
['%m', 'mm'],
['%b', 'M'],
['%B', 'MM'],
['%d', 'dd'],
['%Y', 'yy'],
['%y', 'y']
['%a', 'D'],
['%A', 'DD'],
['%y', 'y'],
['%Y', 'yy']
]
translations.inject(standard_format) do |str, translation|
str.gsub(*translation)