[fix #3342] show date with format letter
This commit is contained in:
parent
0cc36aea3b
commit
fb29d30826
3 changed files with 78 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue