mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 05:20:49 +00:00
time: handle 24-hour to 12-hour clock conversion edge cases
This commit is contained in:
+5
-1
@@ -99,7 +99,11 @@ pfUI:RegisterModule("afkcam", "vanilla:tbc", function ()
|
|||||||
local time = ""
|
local time = ""
|
||||||
if C.global.twentyfour == "0" then
|
if C.global.twentyfour == "0" then
|
||||||
if C.global.servertime == "1" then
|
if C.global.servertime == "1" then
|
||||||
if h > 12 then
|
if h == 0 then
|
||||||
|
h = 12
|
||||||
|
elseif h == 12 then
|
||||||
|
noon = "PM"
|
||||||
|
elseif h > 12 then
|
||||||
h = h - 12
|
h = h - 12
|
||||||
noon = "PM"
|
noon = "PM"
|
||||||
end
|
end
|
||||||
|
|||||||
+10
-2
@@ -17,7 +17,11 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function()
|
|||||||
local servertime
|
local servertime
|
||||||
local time
|
local time
|
||||||
if C.global.twentyfour == "0" then
|
if C.global.twentyfour == "0" then
|
||||||
if h > 12 then
|
if h == 0 then
|
||||||
|
h = 12
|
||||||
|
elseif h == 12 then
|
||||||
|
noon = " PM"
|
||||||
|
elseif h > 12 then
|
||||||
h = h - 12
|
h = h - 12
|
||||||
noon = " PM"
|
noon = " PM"
|
||||||
end
|
end
|
||||||
@@ -67,7 +71,11 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function()
|
|||||||
local secondsenabled = C.panel.seconds == "1"
|
local secondsenabled = C.panel.seconds == "1"
|
||||||
if C.global.twentyfour == "0" then
|
if C.global.twentyfour == "0" then
|
||||||
if C.global.servertime == "1" then
|
if C.global.servertime == "1" then
|
||||||
if h > 12 then
|
if h == 0 then
|
||||||
|
h = 12
|
||||||
|
elseif h == 12 then
|
||||||
|
noon = "PM"
|
||||||
|
elseif h > 12 then
|
||||||
h = h - 12
|
h = h - 12
|
||||||
noon = "PM"
|
noon = "PM"
|
||||||
end
|
end
|
||||||
|
|||||||
+10
-2
@@ -146,12 +146,20 @@ pfUI:RegisterModule("turtle-wow", "vanilla", function ()
|
|||||||
if C.global.twentyfour == "0" then
|
if C.global.twentyfour == "0" then
|
||||||
local zn, sn = " AM", " AM"
|
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
|
zh = zh - 12
|
||||||
zn = " PM"
|
zn = " PM"
|
||||||
end
|
end
|
||||||
|
|
||||||
if sh > 12 then
|
if sh == 0 then
|
||||||
|
sh = 12
|
||||||
|
elseif sh == 12 then
|
||||||
|
sn = " PM"
|
||||||
|
elseif sh > 12 then
|
||||||
sh = sh - 12
|
sh = sh - 12
|
||||||
sn = " PM"
|
sn = " PM"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user