From 4073bd7cdf79e118e97c0b0f7dba08927bc31d46 Mon Sep 17 00:00:00 2001 From: Luca CPZ Date: Thu, 6 Sep 2018 16:18:35 +0200 Subject: [PATCH] widget.calendar: some cleaning; #379 --- widget/calendar.lua | 9 +++------ wiki | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/widget/calendar.lua b/widget/calendar.lua index 84b025d..e7b330a 100644 --- a/widget/calendar.lua +++ b/widget/calendar.lua @@ -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 diff --git a/wiki b/wiki index 2268c89..89f3d98 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 2268c893712e579f1b68f25be8ff9caf9767312f +Subproject commit 89f3d98e339f07545aec31e94a3ecf42245b6316 -- 2.39.5