Bug 345498 - monthly To-do given incorrect start and due dates
Summary: monthly To-do given incorrect start and due dates
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcalendarcore
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.71.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 376170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-03-25 02:32 UTC by gjditchfield
Modified: 2020-09-08 10:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gjditchfield 2015-03-25 02:32:11 UTC
When I create a monthly recurring To-do, the due date and start date given to it are not the dates I entered.

Reproducible: Always

Steps to Reproduce:
Note that "today" is 2015-03-24. I have tried this on different days and the due dates and start dates are different, but always wrong.
1. Open the To-do List
2. Click "New To-do". 
3. In the edit dialog, enter Title: "monthly", check off "All Day", choose today's date for the Start date (2015-03-24 in this example), and choose tomorrow's date for the Due date (2015-03-25 in this example).
4. On the Recurrence tab, choose Repeats: Monthly. Accept the defaults for the other fields (on the 24th, Ends: never, no exceptions)
5. Press OK.


Actual Results:  
For this example, my To-do List shows the monthly task with a Start Date of 2015-03-26 and a Due Date of 2015-03-27

Expected Results:  
The To-do List should show a Start Date of 2015-03-24 and a Due Date of 2015-03-25.

Version: Korganizer 4.14.6
OS: Linux (x86_64) release 3.19.0-10-generic (Kubuntu Vivid beta, up-to-date as of 2015-03-24)
Compiler: x86_64-linux-gnu-gcc
Comment 1 Boian Berberov 2017-02-12 03:11:33 UTC
Using openSUSE Tumbleweed; Korganizer version is 5.4.1.

Slightly different behavior now.  The start date and end date are the same.  Still an issue.
Comment 2 Karsten de Freese 2017-03-23 05:58:15 UTC
I can confirm this issue with
KOrganizer 5.3
KDE Applications 16.08.2
OpenSUSE leap 42.2

also for other frequencies of recurrence.
When setting up a non-recurring to-do, everything seems to work as expected - I can set start dates, due dates and reminders without the different settings influencing each other.
However if the to-do is set to recurring, response to the settings is erratic.
An example:
- I set up a to-do, starting the next day (at a specific time), and due one day later. A reminder is set at 15min before due time.
- the to-do is shown correctly in the to-do list view, and also more detailed via the 'show' context menu entry
- when I add a weekly recurrence, start and due dates are mysteriously moved by two days in the to-do list view, while via the 'show' context menu only the due date is shifted, and only by one day..
In other cases I've also seen the reminder being changed in addition, recurrence setting being greyed out, or also an error messages when trying to save the modified task (something like 'only allocated resources are allowed to make changes', I can't reproduce this right now). 

The behavior does seem independent of the calendar type I select - local personal calendar vs. CalDAV
Comment 3 gjditchfield 2017-07-02 21:45:00 UTC
Problem still exists in Korganizer 5.4.3
Comment 4 Karsten de Freese 2019-12-07 19:01:25 UTC
still an issue with Korganizer 5.12.3 (I'm using Tumbleweed)
Comment 5 Karsten de Freese 2019-12-08 00:24:11 UTC
It appears that the problems can be worked around under specific conditions:
- have start & due dates on the same day (e.g. via different times)
- save the to-do before entering the recurrence
Comment 6 gjditchfield 2020-06-10 21:44:39 UTC
Git commit dc7b1865c3bff04d0173505335da22cefa3b5f5f by Glen Ditchfield.
Committed on 10/06/2020 at 15:17.
Pushed by winterz into branch 'master'.

Fix serialization of recurring to-do's start date

KCalendarCore uses Todo::Private::mDtRecurrence to hold the start date
and time of the next uncompleted occurrance of a recurring Todo, and
deserializes it from the X-KDE-LIBKCAL-DTRECURRENCE property of iCalendar
files.  However, ICalFormatImpl::writeTodo() serializes dtDue() into that
property, not dtStart().

When KOrganizer creates a new recurring to-do, it serializes the to-do,
then deserializes it to populate the To-Do List view, so the view shows
an incorrect start date (and an incorrect due date, which is calculated
from the start date).
Related: bug 345565

M  +1    -0    autotests/CMakeLists.txt
A  +83   -0    autotests/testdateserialization.cpp     [License: LGPL(v3.0+)]
A  +19   -0    autotests/testdateserialization.h     [License: LGPL(v3.0+)]
M  +2    -3    src/icalformat_p.cpp

https://invent.kde.org/frameworks/kcalendarcore/commit/dc7b1865c3bff04d0173505335da22cefa3b5f5f
Comment 7 Christoph Feck 2020-09-08 10:16:38 UTC
*** Bug 376170 has been marked as a duplicate of this bug. ***