From 6b792c8fa1b2ba493412cdfada4a38bc7687afef Mon Sep 17 00:00:00 2001 From: Harish Krishnaswamy Date: Fri, 7 Jul 2006 09:50:10 +0000 Subject: Handle the start_time_zone != end_time_zone scenario. Fixes 2006-07-07 Harish Krishnaswamy * gui/e-cal-model.c: (e_cal_model_set_instance_times): Handle the start_time_zone != end_time_zone scenario. Fixes bugzilla.novell.com #190421. svn path=/trunk/; revision=32251 --- calendar/gui/e-cal-model.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'calendar/gui/e-cal-model.c') diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 51441d8fab..2de983ab10 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -2133,5 +2133,27 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, icaltimezone *zon comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone); + if (end_time.zone) + zone = end_time.zone; + else { + icalparameter *param = NULL; + icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY); + + if (prop) { + param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); + + if (param) { + const char *tzid = NULL; + icaltimezone *end_zone = NULL; + + tzid = icalparameter_get_tzid (param); + e_cal_get_timezone (comp_data->client, tzid, &end_zone, NULL); + + if (end_zone) + zone = end_zone; + } + } + + } comp_data->instance_end = icaltime_as_timet_with_zone (end_time, zone); } -- cgit