Skip to content

Commit

Permalink
Add timezone offset setting
Browse files Browse the repository at this point in the history
Clarify timezone offset tooltip

Co-authored-by: y5nw <[email protected]>
  • Loading branch information
Athozus and y5nw committed Apr 20, 2024
1 parent 9a52c1c commit 1dab26f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/message.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions util/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ mail.settings = {
type = "string", default = "%Y-%m-%d %X", group = "other", index = 3, label = S("Date format"),
dataset = {"%Y-%m-%d %X", "%d/%m/%y %X", "%A %d %B %Y %X"}, format = os.date
},
timezone_offset = {
type = "number", default = 0, group = "other", index = 4,
label = S("Timezone offset"), tooltip = S("Offset to add to server time."),
},
mute_list = {
type = "list", default = {}, group = "spam", index = 1,
label = S("Mute list")
Expand Down

0 comments on commit 1dab26f

Please sign in to comment.