diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-12-21 09:21:18 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2019-02-02 18:19:22 +0100 |
commit | 99c7493cd5272f257aba98efd7ff4aa7754e1936 (patch) | |
tree | f423aea17a1e6e27c808c3b7430cd144a4805eaf /src | |
parent | 4eda8f6937a2ca38f02dd7c0b00bb959ef6c96d1 (diff) | |
download | calcurse-99c7493cd5272f257aba98efd7ff4aa7754e1936.tar.gz calcurse-99c7493cd5272f257aba98efd7ff4aa7754e1936.zip |
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 <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ui-day.c | 13 |
1 files 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: |