From 681ad5320f999cdc54cae3fc5cd7f6485a698cf5 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Fri, 14 Feb 2025 11:58:16 +0800 Subject: [PATCH] style: update time display format - Replace local timezone display with UTC in the weather display components - Adjust time formatting in both city and weather art views This change standardizes the time format across the application, making it clear that the displayed times are in UTC, aiding user understanding and consistency in time representation. --- app/views/cities/show.html.erb | 5 +++-- app/views/weather_arts/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/cities/show.html.erb b/app/views/cities/show.html.erb index bd87b53..9040c6f 100644 --- a/app/views/cities/show.html.erb +++ b/app/views/cities/show.html.erb @@ -35,7 +35,8 @@ <%= "#{@city&.country&.emoji + " " || ""}#{@city&.country&.name}" %>, <%= @city.region %>
- <%= @city.timezone.present? ? Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") : "Timezone undefined" %> + <%#= @city.timezone.present? ? Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") : "Timezone undefined" %> + <%= @city&.state&.name %>
@@ -109,7 +110,7 @@
<%= art.temperature %>°C
-
<%= art.created_at.strftime("%H:%M") %>
+
UTC <%= art.created_at.strftime("%H:%M") %>
<%= art.weather_date.strftime("%B %d, %Y") %>
diff --git a/app/views/weather_arts/show.html.erb b/app/views/weather_arts/show.html.erb index dd85448..9c46497 100644 --- a/app/views/weather_arts/show.html.erb +++ b/app/views/weather_arts/show.html.erb @@ -55,7 +55,7 @@ <%= @weather_art.weather_date.strftime("%B %d, %Y") %>
- <%= @weather_art.created_at.strftime("%H:%M") %> + UTC <%= @weather_art.created_at.strftime("%H:%M") %>