Add a setting to choose date format

This commit is contained in:
Athozus 2023-07-17 16:45:57 +02:00
parent db2434c8f9
commit be8f0e590f
No known key found for this signature in database
GPG key ID: B50895022E8484BF
12 changed files with 238 additions and 212 deletions

View file

@ -31,7 +31,7 @@ function mail.show_receivers(name, id)
local cc_str = mail.colors.header .. "," .. S("CC") .. ",,"
cc_str = cc_str .. table.concat(cc, ",,")
local date = type(message.time) == "number"
and minetest.formspec_escape(os.date("%Y-%m-%d %X", message.time)) or ""
and minetest.formspec_escape(os.date(mail.get_setting(name, "date_format"), message.time)) or ""
formspec = string.format(formspec, from, date, to_str, cc_str)
minetest.show_formspec(name, FORMNAME, formspec)