widget.calendar: some cleaning; #379

This commit is contained in:
Luca CPZ 2018-09-06 16:18:35 +02:00
parent 558622c1ec
commit 4073bd7cdf
2 changed files with 4 additions and 7 deletions

View 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

2
wiki

@ -1 +1 @@
Subproject commit 2268c893712e579f1b68f25be8ff9caf9767312f
Subproject commit 89f3d98e339f07545aec31e94a3ecf42245b6316