month-view: fix all-day events end-date

All-day events has an end-date one day after they really end.
This commit is contained in:
Erick Pérez Castellanos
2014-12-26 16:53:05 -05:00
parent 443a502b1f
commit 11324a6712
+1 -5
View File
@@ -1571,10 +1571,8 @@ gcal_month_view_button_release (GtkWidget *widget,
start_date->day -= priv->days_delay; start_date->day -= priv->days_delay;
start_date->is_date = 1; start_date->is_date = 1;
if (priv->start_mark_cell != priv->end_mark_cell)
{
end_date = gcal_dup_icaltime (priv->date); end_date = gcal_dup_icaltime (priv->date);
end_date->day = j - priv->days_delay; end_date->day = j - priv->days_delay + 1;
end_date->is_date = 1; end_date->is_date = 1;
if (start_date->day > end_date->day) if (start_date->day > end_date->day)
@@ -1583,12 +1581,10 @@ gcal_month_view_button_release (GtkWidget *widget,
start_date->day = end_date->day; start_date->day = end_date->day;
end_date->day = day; end_date->day = day;
} }
}
g_signal_emit_by_name (GCAL_VIEW (widget), "create-event", start_date, end_date, x, y); g_signal_emit_by_name (GCAL_VIEW (widget), "create-event", start_date, end_date, x, y);
g_free (start_date); g_free (start_date);
if (end_date != NULL)
g_free (end_date); g_free (end_date);
} }