diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index c856aa5a..704b3b77 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -730,7 +730,9 @@ gcal_month_view_add (GtkContainer *container, new_child->widget = widget; new_child->hidden_by_me = FALSE; - priv->days[day] = g_list_append (priv->days[day], new_child); + priv->days[day] = g_list_insert_sorted (priv->days[day], + new_child, + gcal_compare_event_widget_by_date); gtk_widget_set_parent (widget, GTK_WIDGET (container)); } diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index e24f1667..72e74c89 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -427,7 +427,11 @@ gcal_year_view_add (GtkContainer *container, new_child->widget = widget; new_child->hidden_by_me = FALSE; - priv->months[date->month - 1] = g_list_append (priv->months[date->month - 1], new_child); + priv->months[date->month - 1] = + g_list_insert_sorted (priv->months[date->month - 1], + new_child, + gcal_compare_event_widget_by_date); + gtk_widget_set_parent (widget, GTK_WIDGET (container)); g_free (date);