Add loclized date to the calendar-menu.lua script
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user