applets/digital-clock: fix timezone offset

Original commit message(s)

  • applets/digital-clock: fix timezone offset

formatOffset() used a floored signed offset to calculate hours, but used a signed modulo to calculate minutes. This produced invalid output for negative offsets with a minute component, such as "2:-30 earlier" for a -90 minute offset.

Calculate both components from the absolute offset while retaining the original sign to choose between "earlier" and "later".

BUG: 522037 FIXED-IN: 6.7.3

Reason for the change

The widget wrongly displayed negative offsets with fractional hours.

Test plan

  1. Set the system time zone to UTC+07:00 or to any time zone ahead of IST.
  2. Add Asia/Kolkata (IST, UTC+05:30) as an additional Digital Clock timezone.
  3. Open the clock tooltip.

Screenshots or screen recordings

Before After
Screenshot_20260623_120341 Screenshot_20260623_131030

Bugs fixed

BUG: 522037 FIXED-IN: 6.7.3

Edited by Nate Graham

Merge request reports

Loading