Add loclized date to the calendar-menu.lua script

This commit is contained in:
Evgeny
2023-09-08 08:25:27 +04:00
parent c8f0e8be79
commit 5ad5be396f

View File

@@ -26,13 +26,21 @@ function on_drawer_open()
end end
lines = map(events, function(it) lines = map(events, function(it)
local date = fmt.colored(os.date("%d.%m", it.begin), it.color) local date = fmt.colored(format_date(it.begin), it.color)
return date..fmt.space(4)..it.title return date..fmt.space(4)..it.title
end) end)
drawer:show_ext_list(lines) drawer:show_ext_list(lines)
end end
function format_date(date)
if system.format_date_localized then
return system:format_date_localized("dd.MM", date)
else
return os.date("%d.%m", date)
end
end
function on_click(idx) function on_click(idx)
if not have_permission then return end if not have_permission then return end