2 -- ion/mod_statusbar/ion-statusd/statusd_date.lua
4 -- Copyright (c) Tuomo Valkonen 2004-2006.
6 -- Ion is free software; you can redistribute it and/or modify it under
7 -- the terms of the GNU Lesser General Public License as published by
8 -- the Free Software Foundation; either version 2.1 of the License, or
9 -- (at your option) any later version.
16 date_format='%a %Y-%m-%d %H:%M',
20 local settings=table.join(statusd.get_config('date'), defaults)
22 local function update()
24 statusd.inform('date', os.date(settings.date_format, tm))
25 for k, f in pairs(settings.formats) do
26 statusd.inform('date_'..k, os.date(f, tm))
31 local function timer_handler(tmr)
34 local t=os.date('*t', tm)
35 local d=(60-t.sec)*1000
37 timer:set(d, timer_handler)
40 timer=statusd.create_timer()