From 0e45273330288370dc6bad630db4159f5a2b104f Mon Sep 17 00:00:00 2001 From: Raghuveer Kasaraneni Date: Mon, 21 Mar 2022 19:24:25 +0100 Subject: [PATCH] dateMenu: Limit timezone offset hours to integers If the timezone offset calculation in the World Clocks contains non-zero minutes, then a decimal Hours value is being displayed. Limit the Hours value to integers by using Math.floor(). Part-of: --- js/ui/dateMenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 71b932ad7..ca98cdd24 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -467,7 +467,8 @@ class WorldClocksSection extends St.Button { const localOffset = GLib.DateTime.new_now_local().get_utc_offset(); const utcOffset = GLib.DateTime.new_now(tz).get_utc_offset(); const offsetCurrentTz = utcOffset - localOffset; - const offsetHours = Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR; + const offsetHours = + Math.floor(Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR); const offsetMinutes = (Math.abs(offsetCurrentTz) % GLib.TIME_SPAN_HOUR) / GLib.TIME_SPAN_MINUTE;