From 99c7493cd5272f257aba98efd7ff4aa7754e1936 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Fri, 21 Dec 2018 09:21:18 +0100 Subject: Fix deletion of a multi-day recurrent appointment When the selected day in the calendar is a continuation day (not the first day) of such an appointment, deleting the occurrence does not work. The reason is that the selected day, and not the first day of the occurrence, is added as an exception day. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/ui-day.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui-day.c b/src/ui-day.c index 9d76775..de8f8fa 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -681,7 +681,7 @@ void ui_day_item_delete(unsigned reg) "Delete (i)tem or just its (n)ote?"); const char *note_choices = _("[in]"); const int nb_note_choices = 2; - long date = ui_calendar_get_slctd_day_sec(); + time_t date = 0, occurrence; if (day_item_count(0) <= 0) return; @@ -715,7 +715,16 @@ void ui_day_item_delete(unsigned reg) case 1: break; case 2: - day_item_add_exc(p, date); + if (p->type == RECUR_EVNT) { + date = ui_calendar_get_slctd_day_sec(); + day_item_add_exc(p, date); + } else { + date = update_time_in_date(p->start, 0, 0); + recur_apoint_find_occurrence(p->item.rapt, + date, + &occurrence); + day_item_add_exc(p, occurrence); + } io_set_modified(); return; default: -- cgit v1.2.3-54-g00ecf