aboutsummaryrefslogtreecommitdiff
path: root/widgets/date.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 01:55:33 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 01:55:33 +0100
commit237470c8f45190b213e3a173ce6ae1a74b3e11fe (patch)
tree7f53c8144761947d4bde20715bcad34f4be0d6c0 /widgets/date.lua
parent9a82d4113a8271b7dfc7506f2b07379e3ede89a8 (diff)
downloadvicious-legacy-237470c8f45190b213e3a173ce6ae1a74b3e11fe.tar.xz
API: transform widgets namespace table to a directory
Diffstat (limited to 'widgets/date.lua')
-rw-r--r--widgets/date.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/widgets/date.lua b/widgets/date.lua
new file mode 100644
index 0000000..68a803d
--- /dev/null
+++ b/widgets/date.lua
@@ -0,0 +1,23 @@
+---------------------------------------------------
+-- Licensed under the GNU General Public License v2
+-- * (c) 2010, Adrian C. <anrxc@sysphere.org>
+-- * (c) 2009, Lucas de Vries <lucas@glacicle.com>
+---------------------------------------------------
+
+-- {{{ Grab environment
+local os = { date = os.date }
+local setmetatable = setmetatable
+-- }}}
+
+
+-- Date: provides access to os.date with optional custom formatting
+module("vicious.widgets.date")
+
+
+-- {{{ Date widget type
+local function worker(format)
+ return os.date(format or nil)
+end
+-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })