diff --git a/Library/Widgets/Calendar.md b/Library/Widgets/Calendar.md index 941368f..417f9b8 100644 --- a/Library/Widgets/Calendar.md +++ b/Library/Widgets/Calendar.md @@ -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[[