Ironed out another december bug
This commit is contained in:
parent
6cdb1c9bd8
commit
f825acc8c0
1 changed files with 3 additions and 5 deletions
|
|
@ -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[[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue