Ironed out another december bug

This commit is contained in:
Magnus Åhall 2025-11-17 10:32:46 +01:00
parent 6cdb1c9bd8
commit f825acc8c0

View file

@ -11,15 +11,13 @@ function generate_calendar(calendarID, year, month)
-- A specified year and month will always display that calendar.
if year == 0 and month == 0 then
local wantedMonth = clientStore.get("calendar:" .. calendarID)
editor.flashNotification(wantedMonth)
-- Calculate year and month from the current date plus a month offset.
if wantedMonth == nil then
wantedMonth = tonumber(os.date("%Y")) * 12 + tonumber(os.date("%m"))
wantedMonth = tonumber(os.date("%Y")) * 12 + (tonumber(os.date("%m"))-1)
end
year = (wantedMonth - (wantedMonth % 12)) / 12
month = wantedMonth % 12
if month == 0 then
month = 12
end
month = wantedMonth % 12 + 1
end
local events = query[[