[fix #3342] show date with format letter

This commit is contained in:
pedong 2019-01-31 17:11:53 +01:00
parent 0cc36aea3b
commit fb29d30826
3 changed files with 78 additions and 0 deletions

View file

@ -119,4 +119,20 @@ module ApplicationHelper
{}
end
end
def try_format_date(date)
begin
Date.parse(date).strftime("%d %B %Y")
rescue
date
end
end
def try_format_datetime(datetime)
begin
Time.zone.parse(datetime).strftime("%d %B %Y %R")
rescue
datetime
end
end
end