event: handle different tzid formats
tzid can have different formats depending on where it originates from: regular or prefixed by a libical specific identifier. Use the right icaltimezone_get_builtin_timezone* for each case. https://bugzilla.gnome.org/show_bug.cgi?id=763180
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
681ec191f0
commit
e464eb6415
+7
-1
@@ -19,6 +19,8 @@
|
|||||||
#include "gcal-event.h"
|
#include "gcal-event.h"
|
||||||
#include "gcal-utils.h"
|
#include "gcal-utils.h"
|
||||||
|
|
||||||
|
#define LIBICAL_TZID_PREFIX "/freeassociation.sourceforge.net/"
|
||||||
|
|
||||||
struct _GcalEvent
|
struct _GcalEvent
|
||||||
{
|
{
|
||||||
GObject parent;
|
GObject parent;
|
||||||
@@ -95,7 +97,11 @@ get_timezone_from_ical (ECalComponentDateTime *comp)
|
|||||||
gchar *tzid;
|
gchar *tzid;
|
||||||
gint offset;
|
gint offset;
|
||||||
|
|
||||||
zone = icaltimezone_get_builtin_timezone (comp->tzid);
|
if (g_str_has_prefix (comp->tzid, LIBICAL_TZID_PREFIX))
|
||||||
|
zone = icaltimezone_get_builtin_timezone_from_tzid (comp->tzid);
|
||||||
|
else
|
||||||
|
zone = icaltimezone_get_builtin_timezone (comp->tzid);
|
||||||
|
|
||||||
offset = icaltimezone_get_utc_offset (zone, comp->value, NULL);
|
offset = icaltimezone_get_utc_offset (zone, comp->value, NULL);
|
||||||
tzid = format_utc_offset (offset);
|
tzid = format_utc_offset (offset);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user