1
1
Fork 0
mirror of https://github.com/vicious-widgets/vicious synced 2023-12-14 07:13:07 +01:00
vicious/date.lua

27 lines
672 B
Lua

----------------------------------------------------------
-- Licensed under the GNU General Public License version 2
-- * Copyright (C) 2009 Adrian C. <anrxc_sysphere_org>
----------------------------------------------------------
-- {{{ Grab environment
local os = { date = os.date }
local setmetatable = setmetatable
-- }}}
-- Date: provides access to os.date with optional custom formatting
module("vicious.date")
-- {{{ Date widget type
function worker(format)
-- Get format
if format == nil then
return os.date()
else
return os.date(format)
end
end
-- }}}
setmetatable(_M, { __call = function(_, ...) return worker(...) end })