oz / tz

🌐 A time zone helper
GNU General Public License v3.0
849 stars 33 forks source link

Fix #4: Support timezones with non-hourly (non-integer) UTC offsets #38

Closed jnd-au closed 1 year ago

jnd-au commented 1 year ago

Use the correct start hour for all timezones even when the UTC offset isn’t a round number of hours.

Before this fix the wrong start hour (integer) was calculated when timezones involved a part-hour offset, causing the wrong current hour to be highlighted, and entire timezone rows to be misaligned. This bug #4 impacted tz for more than a billion people. For example when working with India Standard Time (IST = UTC+05:30, known as “Asia/Calcutta” in tkuchiki/go-timezone) at UTC=12:45, tz could align India with 5 am as the current displayed hour but it should have been 6 am.

This fix uses the same approach as the emojis, which were displayed correctly.

oz commented 1 year ago

Hey James!

Thanks for the PR. This looks pretty great. 👍🏻