aboutsummaryrefslogtreecommitdiff
path: root/widgets/date.lua
diff options
context:
space:
mode:
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 })