diff --git a/meson.build b/meson.build index a634abf08..cf044f7c9 100644 --- a/meson.build +++ b/meson.build @@ -32,7 +32,7 @@ tasks_deps = [ dependency('champlain-gtk-0.12'), dependency('clutter-1.0'), dependency('clutter-gtk-1.0'), - dependency('glib-2.0'), + dependency('glib-2.0', version: '>=2.68'), dependency('gobject-2.0'), dependency('granite', version: '>=6.2.0'), dependency('gtk+-3.0'), diff --git a/src/Util.vala b/src/Util.vala index b3adf703c..d16e39ea2 100644 --- a/src/Util.vala +++ b/src/Util.vala @@ -161,16 +161,18 @@ namespace Tasks.Util { * will always return a GLib.TimeZone, which will be UTC if parsing * fails for some reason. */ - var prefix = "/freeassociation.sourceforge.net/"; - if (tzid.has_prefix (prefix)) { - // TZID has prefix "/freeassociation.sourceforge.net/", - // indicating a libical TZID. - return new GLib.TimeZone (tzid.offset (prefix.length)); - } else { - // TZID does not have libical prefix, potentially indicating an Olson - // standard city name. - return new GLib.TimeZone (tzid); - } + try { + var prefix = "/freeassociation.sourceforge.net/"; + if (tzid.has_prefix (prefix)) { + // TZID has prefix "/freeassociation.sourceforge.net/", + // indicating a libical TZID. + return new GLib.TimeZone.identifier (tzid.offset (prefix.length)); + } else { + // TZID does not have libical prefix, potentially indicating an Olson + // standard city name. + return new GLib.TimeZone.identifier (tzid); + } + } catch (Error e) {} // Fall through code deals with error } // If tzid fails, try ICal.Time.get_timezone () unowned ICal.Timezone? timezone = null; @@ -191,7 +193,11 @@ namespace Tasks.Util { var minutes = (interval % 3600) / 60; var hour_string = "%s%02d:%02d".printf (is_positive ? "+" : "-", hours, minutes); - return new GLib.TimeZone (hour_string); + try { + return new GLib.TimeZone.identifier (hour_string); + } catch (Error e) { + return new GLib.TimeZone.local (); + } } /**