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

@ -39,7 +39,7 @@ 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("%Y-%m-%d %X", message.time)) or ""
and minetest.formspec_escape(os.date(mail.get_setting(name, "date_format"), message.time)) 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)