Merge branch 'master' of http://git.sysphere.org/vicious
This commit is contained in:
commit
418f492dd9
7
README
7
README
|
@ -265,8 +265,11 @@ vicious.widgets.weather
|
|||
{windkmh}, {sky}, {weather}, {tempf}, {tempc}, {humid}, {press}
|
||||
|
||||
vicious.widgets.date
|
||||
- provides access to os.date, with optional custom formatting;
|
||||
provided as the format string
|
||||
- provides access to os.date, with optional time formatting provided
|
||||
as the format string - using regular date sequences
|
||||
- takes optional time offset, in seconds, as an argument for example
|
||||
to calculate time zone differences, otherwise current time is
|
||||
formatted
|
||||
- returns the output of os.date(), formatted by provided sequences
|
||||
|
||||
|
||||
|
|
|
@ -5,18 +5,21 @@
|
|||
---------------------------------------------------
|
||||
|
||||
-- {{{ Grab environment
|
||||
local os = { date = os.date }
|
||||
local setmetatable = setmetatable
|
||||
local os = {
|
||||
date = os.date,
|
||||
time = os.time
|
||||
}
|
||||
-- }}}
|
||||
|
||||
|
||||
-- Date: provides access to os.date with optional custom formatting
|
||||
-- Date: provides access to os.date with optional time formatting
|
||||
module("vicious.widgets.date")
|
||||
|
||||
|
||||
-- {{{ Date widget type
|
||||
local function worker(format)
|
||||
return os.date(format or nil)
|
||||
local function worker(format, warg)
|
||||
return os.date(format or nil, warg and os.time()+warg or nil)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue