diff options
Diffstat (limited to 'calendar/gui/e-cal-model-calendar.c')
-rw-r--r-- | calendar/gui/e-cal-model-calendar.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index 3649352372..4754927bbd 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -112,22 +112,34 @@ ecmc_column_count (ETableModel *etm) } static ECellDateEditValue * -get_dtend (ECalModelComponent *comp_data) +get_dtend (ECalModel *model, ECalModelComponent *comp_data) { struct icaltimetype tt_end; if (!comp_data->dtend) { icaltimezone *zone; + gboolean got_zone = FALSE; tt_end = icalcomponent_get_dtend (comp_data->icalcomp); + if (icaltime_get_tzid (tt_end) + && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL)) + got_zone = TRUE; + + if ((e_cal_model_get_flags (model) & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES) && + (e_cal_util_component_has_recurrences (comp_data->icalcomp))) { + if (got_zone) + tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, zone); + else + tt_end = icaltime_from_timet (comp_data->instance_end, tt_end.is_date); + } + if (!icaltime_is_valid_time (tt_end)) return NULL; comp_data->dtend = g_new0 (ECellDateEditValue, 1); comp_data->dtend->tt = tt_end; - if (icaltime_get_tzid (tt_end) - && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL)) + if (got_zone) comp_data->dtend->zone = zone; else comp_data->dtend->zone = NULL; @@ -192,7 +204,7 @@ ecmc_value_at (ETableModel *etm, int col, int row) switch (col) { case E_CAL_MODEL_CALENDAR_FIELD_DTEND : - return get_dtend (comp_data); + return get_dtend (model, comp_data); case E_CAL_MODEL_CALENDAR_FIELD_LOCATION : return get_location (comp_data); case E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY : |