mirror of
https://repo.or.cz/minetest_orienteering.git
synced 2024-12-04 21:03:49 +01:00
Fix 12h clock showing a.m. in the afternoon
This commit is contained in:
parent
0252ceecc1
commit
9675e81249
8
init.lua
8
init.lua
@ -319,12 +319,12 @@ function orienteering.update_hud_displays(player)
|
||||
elseif hours == 0 and minutes == 0 then
|
||||
str_time = S("Time: midnight")
|
||||
else
|
||||
hours = math.fmod(hours, 12)
|
||||
if hours == 0 then hours = 12 end
|
||||
local hours12 = math.fmod(hours, 12)
|
||||
if hours12 == 0 then hours12 = 12 end
|
||||
if hours >= 12 then
|
||||
str_time = S("Time: @1:@2 p.m.", string.format("%i", hours), string.format("%02i", minutes))
|
||||
str_time = S("Time: @1:@2 p.m.", string.format("%i", hours12), string.format("%02i", minutes))
|
||||
else
|
||||
str_time = S("Time: @1:@2 a.m.", string.format("%i", hours), string.format("%02i", minutes))
|
||||
str_time = S("Time: @1:@2 a.m.", string.format("%i", hours12), string.format("%02i", minutes))
|
||||
end
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user