Bug 483707 - When selecting a end date for a recurring event the wrong date is saved
Summary: When selecting a end date for a recurring event the wrong date is saved
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: recurrence (show other bugs)
Version: 6.0.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-15 21:50 UTC by Kai
Modified: 2024-04-02 07:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai 2024-03-15 21:50:00 UTC
SUMMARY
When selecting a end date for a recurring event the date before the selected date is used.

STEPS TO REPRODUCE
1. Create a recurring event with a end date ending "on" a specific date
2. See that the event ends one day before the selected date


OBSERVED RESULT
The saved date to end the recurring event is one day before the selected event.

EXPECTED RESULT
The selected event should be used.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.7.9-arch1-1 (64-bit)
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.2
Qt Version: 6.6.2
Comment 1 Bug Janitor Service 2024-03-29 14:32:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcalendarcore/-/merge_requests/171
Comment 2 Daniel Vrátil 2024-04-02 07:16:54 UTC
Git commit f74313db7456f20a16c7a74133218b85b123c093 by Daniel Vrátil.
Committed on 29/03/2024 at 14:31.
Pushed by cullmann into branch 'master'.

Fix conversion of date-only icaltimetype to UTC QDateTime

The code in readICalDateTime converts the values in icaltimetype structure
to a QDateTime, using the timezone specified in the icaltimetype. If the
icaltimetype is day-only (e.g. in all-day incidence) then it does not
have any timezone information and so Qt::LocalTime is assumed, and a new
QDateTime is constructed that happens on the midnight (beginning) of the
specified day, in user's current local timezone.

In some cases, the function is asked to return the QDateTime in UTC timezone
(for fields that the RFC mandates be always in UTC, like RRULE's UNTIL).
If the user's local timezone is in positive UTC offset, the QDateTime
gets converted to UTC, which shifts those \"all-day\" QDateTimes back
by one day. Later in the code, when it realizes it should be dealing only
with a date, the timezone information is discarded and we end up with a
QDate(Time) that is off by one day compared to what's stored in the iCal data.

This fixes simplifies the handling of day-only icaltimetype and makes sure
to construct the QDateTime already in the correct timezone (i.e. UTC) so
no more conversions are necessary.
FIXED-IN: 6.1.0

M  +31   -0    autotests/testicalformat.cpp
M  +1    -0    autotests/testicalformat.h
M  +4    -4    src/icalformat_p.cpp

https://invent.kde.org/frameworks/kcalendarcore/-/commit/f74313db7456f20a16c7a74133218b85b123c093