Bug 448703 - timezone information being lost when copying or moving events
Summary: timezone information being lost when copying or moving events
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: 5.18.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-18 11:24 UTC by MAG4
Modified: 2024-01-11 09:04 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MAG4 2022-01-18 11:24:46 UTC
SUMMARY
timezone information being lost when copying events (solved by commit 9f4628aa when creating events)
https://invent.kde.org/frameworks/kcalendarcore/-/commit/9f4628aa2c6c90c94fd36d2d4ac8e940adc93680

STEPS TO REPRODUCE
1. Open Korganizer
2. Copy an event with timezone information
3. Export as iCalendar

OBSERVED RESULT
The copied event in the exported .ics file has missing timezone information

EXPECTED RESULT
The copied event in the exported .ics file has timezone information

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian Testing
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.0-2

ADDITIONAL INFORMATION
Comment 1 MAG4 2022-02-02 12:32:22 UTC
Thanks to https://bugs.kde.org/show_bug.cgi?id=448846 we investigate further and we find that also moving events directly on calendar views makes timezone information being lost.
Timezone information are correctly saved only if you use Event dialog as https://bugs.kde.org/attachment.cgi?id=145781 (useful as a temporary workaround).
Greetings!

Guido
Comment 2 Bug Janitor Service 2023-08-23 14:52:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/kcalutils/-/merge_requests/29
Comment 3 Bug Janitor Service 2023-08-23 14:53:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/eventviews/-/merge_requests/89
Comment 4 Daniel Vrátil 2023-08-24 15:44:49 UTC
Git commit ddbad7221ee1c7736212887d1d64142d6d174000 by Daniel Vrátil.
Committed on 23/08/2023 at 16:56.
Pushed by dvratil into branch 'release/23.08'.

Preserve timezone of original incidence when copy-pasting

The destination date-time provided by the caller will likely be in
local time, but could theoretically be in any arbitrary timezone.
Since we are creating a *copy* it makes sense to preserve the timezone
of the original dtStart/dtEnd/dtDue in the incidence.
FIXED-IN: 5.24.1

M  +20   -5    src/dndfactory.cpp

https://invent.kde.org/pim/kcalutils/-/commit/ddbad7221ee1c7736212887d1d64142d6d174000
Comment 5 Daniel Vrátil 2023-08-24 15:46:12 UTC
Git commit def2b7f4cc507bcf8f64540e77dd736ebb751e7d by Daniel Vrátil.
Committed on 23/08/2023 at 16:55.
Pushed by dvratil into branch 'release/23.08'.

Agenda: fix timezone being lost when moving event by drag

The code was using QDateTime::toTimeSpec() in attempt to restore the
timezone from the original dtStart/dtEnd. However, QDateTime::toTimeSpec()
automatically converts Qt::TimeZone timespec to Qt::LocalTime, so the
information about timezone was lost and the time was treated as local.

The solution is to restore the timezone manually when the original
timespec was Qt::TimeZone.
FIXED-IN: 5.24.1

M  +22   -4    src/agenda/agendaview.cpp

https://invent.kde.org/pim/eventviews/-/commit/def2b7f4cc507bcf8f64540e77dd736ebb751e7d
Comment 6 Daniel Vrátil 2024-01-11 09:04:18 UTC
Git commit 916130a1c168c6e36a960c6c706a650b949cc0cc by Daniel Vrátil.
Committed on 11/01/2024 at 10:04.
Pushed by dvratil into branch 'master'.

Agenda: fix timezone being lost when moving event by drag

The code was using QDateTime::toTimeSpec() in attempt to restore the
timezone from the original dtStart/dtEnd. However, QDateTime::toTimeSpec()
automatically converts Qt::TimeZone timespec to Qt::LocalTime, so the
information about timezone was lost and the time was treated as local.

The solution is to restore the timezone manually when the original
timespec was Qt::TimeZone.
FIXED-IN: 5.24.1
(cherry picked from commit def2b7f4cc507bcf8f64540e77dd736ebb751e7d)

M  +22   -4    src/agenda/agendaview.cpp

https://invent.kde.org/pim/eventviews/-/commit/916130a1c168c6e36a960c6c706a650b949cc0cc