This commit is contained in:
Joerg T. (Mic92) 2010-10-08 14:11:48 +02:00
commit 418f492dd9
2 changed files with 12 additions and 6 deletions

7
README
View File

@ -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

View File

@ -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
-- }}}