Skip to content
Verified Commit f74313db authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

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.

BUG: 483707
FIXED-IN: 6.1.0
parent 9bf3506c
Pipeline #650223 passed with stage
in 4 minutes and 20 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment