[gnome-calendar] year-view: criticals on last day of month events
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] year-view: criticals on last day of month events
- Date: Mon, 14 Mar 2016 19:55:51 +0000 (UTC)
commit 465d786ae860bf7b51ef431fa50496cff4df96dd
Author: fosero <fosero users noreply github com>
Date: Thu Mar 3 01:07:26 2016 +0100
year-view: criticals on last day of month events
Adding 1 to the day variable at the end of the month results in an
invalid datetime, use g_date_time_add_days instead.
https://bugzilla.gnome.org/show_bug.cgi?id=763015
src/gcal-year-view.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 0b7ed9b..a293b42 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -285,11 +285,7 @@ add_event_to_day_array (GcalYearView *year_view,
/* normalize date on each new event */
date = icaltime_to_datetime (year_view->start_selected_date);
- second_date = g_date_time_new (gcal_event_get_timezone (event),
- g_date_time_get_year (date),
- g_date_time_get_month (date),
- g_date_time_get_day_of_month (date) + 1,
- 0, 0, 0);
+ second_date = g_date_time_add_days (date, 1);
/* marking and cloning */
for (i = 0; i < days_span; i++)
@@ -1054,12 +1050,16 @@ add_event_clicked_cb (GcalYearView *year_view,
else
{
icaltimetype *dtstart, *dtend;
+ GDateTime *tmp_date;
dtstart = year_view->start_selected_date;
dtend = year_view->end_selected_date;
start_date = g_date_time_new_local (dtstart->year, dtstart->month, dtstart->day, 0, 0, 0);
- end_date = g_date_time_new_local (dtend->year, dtend->month, dtend->day + 1, 0, 0, 0);
+ tmp_date = g_date_time_new_local (dtend->year, dtend->month, dtend->day, 0, 0, 0);
+ end_date = g_date_time_add_days (tmp_date, 1);
+
+ g_clear_pointer (&tmp_date, g_date_time_unref);
}
if (year_view->popover_mode)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]