date: accept time as a widget argument
Format custom time for example to calculate time zone differences, New York time relative to me would be widget argument: os.time()-21600
This commit is contained in:
parent
a9d6ea21e6
commit
c6085eef06
6
README
6
README
|
@ -265,8 +265,10 @@ 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
|
||||
- takes optional time as an argument, for example to calculate
|
||||
time-zone differences, otherwise it formats the current time
|
||||
- returns the output of os.date(), formatted by provided sequences
|
||||
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ local setmetatable = setmetatable
|
|||
-- }}}
|
||||
|
||||
|
||||
-- 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 or nil)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue