[gnome-shell/gnome-41] dateMenu: Limit timezone offset hours to integers



commit 8b329ee7bc268b5d3ab2cf883cd8272530454d92
Author: Raghuveer Kasaraneni <raghu kasara net>
Date:   Mon Mar 21 19:24:25 2022 +0100

    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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2255>

 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 6edd790a05..0fdfb8bcda 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -415,7 +415,8 @@ class WorldClocksSection extends St.Button {
         const localOffset = GLib.DateTime.new_now_local().get_utc_offset();
         const utcOffset = this._getTimeAtLocation(location).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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]