File: date.lua

package info (click to toggle)
awesome-extra 2012061101
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 976 kB
  • ctags: 562
  • sloc: sh: 79; awk: 18; makefile: 11
file content (26 lines) | stat: -rw-r--r-- 685 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---------------------------------------------------
-- 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 setmetatable = setmetatable
local os = {
    date = os.date,
    time = os.time
}
-- }}}


-- Date: provides access to os.date with optional time formatting
module("vicious.widgets.date")


-- {{{ Date widget type
local function worker(format, warg)
    return os.date(format or nil, warg and os.time()+warg or nil)
end
-- }}}

setmetatable(_M, { __call = function(_, ...) return worker(...) end })