From 529f7118b1448b337288d384d8e2124898a40920 Mon Sep 17 00:00:00 2001 From: ricola Date: Wed, 3 Dec 2025 22:40:25 +0100 Subject: [PATCH] Fix using format_date on first page after login --- vedia.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vedia.rb b/vedia.rb index ecba199..5002b33 100644 --- a/vedia.rb +++ b/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)