Skip to content

Commit 3c8319f

Browse files
fix(calendar): Fallback to current date if selected date is not a valid number
1 parent 56ac3fb commit 3c8319f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/orgmode/objects/calendar.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,10 @@ function Calendar:get_selected_date()
568568
local line = vim.fn.line('.')
569569
vim.cmd([[redraw!]])
570570
if line < 3 or not char:match('%d') then
571-
return utils.echo_warning('Please select valid day number.', nil, false)
571+
utils.notify('Please select valid day number.', {
572+
level = 'warn',
573+
})
574+
return self.date
572575
end
573576
return self.date:set({
574577
day = day,

0 commit comments

Comments
 (0)