Fix using format_date on first page after login

This commit is contained in:
ricola 2025-12-03 22:40:25 +01:00
parent 134ebec01f
commit 529f7118b1

View file

@ -510,7 +510,12 @@ helpers do
end end
def format_date(timestamp) 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 end
def format_date_and_time(timestamp) def format_date_and_time(timestamp)