Add timezone offset setting

Clarify timezone offset tooltip

Co-authored-by: y5nw <37980625+y5nw@users.noreply.github.com>
This commit is contained in:
Athozus 2024-04-14 15:46:23 +02:00
parent 9a52c1c181
commit 1dab26f0bf
2 changed files with 6 additions and 1 deletions

View file

@ -58,7 +58,8 @@ function mail.show_message(name, id)
local cc = minetest.formspec_escape(message.cc) or ""
if string.len(cc) > 50 then cc = string.sub(cc, 1, 47) .. "..." end
local date = type(message.time) == "number"
and minetest.formspec_escape(os.date(mail.get_setting(name, "date_format"), message.time)) or ""
and minetest.formspec_escape(os.date(mail.get_setting(name, "date_format"),
message.time+3600*mail.get_setting(name, "timezone_offset"))) or ""
local subject = minetest.formspec_escape(message.subject) or ""
local body = minetest.formspec_escape(message.body) or ""
formspec = string.format(formspec, from, to, cc, date, subject, body)