Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
[kcalcore] Return tz parameter in case of offset mismatch. Contribute…
Browse files Browse the repository at this point in the history
…s to JB#48628

See also mkcal tst_storage::tst_vtimezone(brisbane vtimezone) test.
  • Loading branch information
Chris Adams committed Jan 21, 2020
1 parent 3ef35e5 commit 5cd355d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kcalcore/icaltimezones.cpp
Expand Up @@ -1044,6 +1044,10 @@ ICalTimeZone ICalTimeZoneSource::parse( MSTimeZone *tz, ICalTimeZones &zones )
}
const ICalTimeZone oldzone = zones.zone( zone );
if ( oldzone.isValid() ) {
const QDateTime currDateTime = QDateTime::currentDateTimeUtc();
if ( zone.offsetAtUtc(currDateTime) != oldzone.offsetAtUtc(currDateTime) ) {
return zone; // use the new zone, as its offset data is what the client wants.
}
// A similar zone already exists in the collection, so don't add this
// new zone, return old zone instead.
return oldzone;
Expand Down

0 comments on commit 5cd355d

Please sign in to comment.