diff --git a/lua/pending/recur.lua b/lua/pending/recur.lua index 46a5dd2..c0a2091 100644 --- a/lua/pending/recur.lua +++ b/lua/pending/recur.lua @@ -3,6 +3,7 @@ ---@field interval integer ---@field byday? string[] ---@field from_completion boolean +---@field _raw? string ---@class pending.recur local M = {} @@ -101,12 +102,12 @@ local function advance_date(base_date, freq, interval) new_y = new_y + 1 end local last_day = os.date('*t', os.time({ year = new_y, month = new_m + 1, day = 0 })) --[[@as osdate]] - local clamped_d = math.min(dn, last_day.day) + local clamped_d = math.min(dn, last_day.day --[[@as integer]]) return os.date('%Y-%m-%d', os.time({ year = new_y, month = new_m, day = clamped_d })) --[[@as string]] elseif freq == 'yearly' then local new_y = yn + interval local last_day = os.date('*t', os.time({ year = new_y, month = mn + 1, day = 0 })) --[[@as osdate]] - local clamped_d = math.min(dn, last_day.day) + local clamped_d = math.min(dn, last_day.day --[[@as integer]]) return os.date('%Y-%m-%d', os.time({ year = new_y, month = mn, day = clamped_d })) --[[@as string]] end return base_date