]> git.madduck.net Git - etc/awesome.git/blobdiff - widget/calendar.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

widget.calendar: some cleaning; #379
[etc/awesome.git] / widget / calendar.lua
index 84b025d5d9b5f707fecf4c0a4b551fc4bc566e20..e7b330ad4282c9825277df0737d187ac0a03ee2e 100644 (file)
@@ -10,9 +10,8 @@ local markup       = require("lain.util.markup")
 local awful        = require("awful")
 local naughty      = require("naughty")
 local mouse        = mouse
-local os           = { date   = os.date }
-local string       = { format = string.format,
-                       gsub   = string.gsub }
+local os           = os
+local string       = string
 local ipairs       = ipairs
 local tonumber     = tonumber
 local setmetatable = setmetatable
@@ -40,10 +39,8 @@ function calendar.show(t_out, inc_offset, scr)
         calendar.icon   = calendar.icons:len() > 0 and string.format("%s%s.png", calendar.icons, tonumber(os.date("%d")))
         f               = calendar.cal
     else -- no current month showing, no day to highlight
-       local month = tonumber(os.date("%m"))
        local year  = tonumber(os.date("%Y"))
-
-       month = month + calendar.offset
+       local month = tonumber(os.date("%m")) + calendar.offset
 
        while month > 12 do
            month = month - 12