event-widget: fix events with no end date

This commit is contained in:
Erick Pérez Castellanos
2015-02-16 09:31:21 -05:00
parent 4c7a99e7bf
commit 8f1b118abb
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -912,7 +912,7 @@ gcal_event_widget_peek_end_date (GcalEventWidget *event)
GcalEventWidgetPrivate *priv;
priv = gcal_event_widget_get_instance_private (event);
return priv->dt_end;
return priv->dt_end != NULL ? priv->dt_end : priv->dt_start;
}
void
+3
View File
@@ -397,6 +397,9 @@ gint
icaltime_compare_date (const icaltimetype *date1,
const icaltimetype *date2)
{
if (date2 == NULL)
return 0;
if (date1->year < date2->year)
return -1;
else if (date1->year > date2->year)
+4 -1
View File
@@ -1158,7 +1158,10 @@ gcal_year_view_component_added (ECalDataModelSubscriber *subscriber,
e_cal_component_free_datetime (&date);
e_cal_component_get_dtend (comp, &date);
event_end = icaltime_as_timet_with_zone (*(date.value), date.value->zone != NULL ? date.value->zone : zone);
if (date.value != NULL)
event_end = icaltime_as_timet_with_zone (*(date.value), date.value->zone != NULL ? date.value->zone : zone);
else
event_end = event_start;
e_cal_component_free_datetime (&date);
if (!((event_start <= range_start && event_end >= range_end) ||