Fix using format_date on first page after login
This commit is contained in:
parent
134ebec01f
commit
529f7118b1
1 changed files with 6 additions and 1 deletions
7
vedia.rb
7
vedia.rb
|
|
@ -510,7 +510,12 @@ helpers do
|
|||
end
|
||||
|
||||
def format_date(timestamp)
|
||||
"#{TZInfo::Timezone.get(session[:timezone]).to_local(timestamp).strftime('%F')}"
|
||||
if session[:timezone]
|
||||
"#{TZInfo::Timezone.get(session[:timezone]).to_local(timestamp).strftime('%F')}"
|
||||
else
|
||||
# Otherwise, format_date fails on first page after login. Not sure why...
|
||||
"#{timestamp.strftime('%F')}"
|
||||
end
|
||||
end
|
||||
|
||||
def format_date_and_time(timestamp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue