mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
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>
This commit is contained in:
parent
19dc551771
commit
0e45273330
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue