time: handle 24-hour to 12-hour clock conversion edge cases

This commit is contained in:
Ben
2025-06-08 08:57:28 +02:00
committed by GitHub
parent 8bca6cd8ad
commit 8ad04f2b49
3 changed files with 25 additions and 5 deletions
+10 -2
View File
@@ -146,12 +146,20 @@ pfUI:RegisterModule("turtle-wow", "vanilla", function ()
if C.global.twentyfour == "0" then
local zn, sn = " AM", " AM"
if zh > 12 then
if zh == 0 then
zh = 12
elseif zh == 12 then
zn = " PM"
elseif zh > 12 then
zh = zh - 12
zn = " PM"
end
if sh > 12 then
if sh == 0 then
sh = 12
elseif sh == 12 then
sn = " PM"
elseif sh > 12 then
sh = sh - 12
sn = " PM"
end