[gnome-shell] dateMenu: Limit timezone offset hours to integers
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dateMenu: Limit timezone offset hours to integers
- Date: Mon, 21 Mar 2022 19:38:02 +0000 (UTC)
commit 0e45273330288370dc6bad630db4159f5a2b104f
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 71b932ad71..ca98cdd248 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]