From e5cd5ba7f5f8ef78dfdc4b9c64f85d3e1ba4d648 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 18 Feb 2016 04:02:37 +0100 Subject: [PATCH] edit-dialog: set UTC timezone when event is all day This is part of the definition of an all day event. --- src/gcal-edit-dialog.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c index 2d707ec8..deb09888 100644 --- a/src/gcal-edit-dialog.c +++ b/src/gcal-edit-dialog.c @@ -480,6 +480,7 @@ gcal_edit_dialog_action_button_clicked (GtkWidget *widget, { GDateTime *start_date; GDateTime *end_date; + gboolean all_day; gchar *note_text; /* Update summary */ @@ -494,8 +495,19 @@ gcal_edit_dialog_action_button_clicked (GtkWidget *widget, g_free (note_text); /* Update all day */ - gcal_event_set_all_day (dialog->event, - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->all_day_check))); + all_day = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->all_day_check)); + + gcal_event_set_all_day (dialog->event, all_day); + + /* By definition, all day events are always UTC */ + if (all_day) + { + GTimeZone *utc = g_time_zone_new_utc (); + + gcal_event_set_timezone (dialog->event, utc); + + g_clear_pointer (&utc, g_time_zone_unref); + } /* Update start & end dates */ start_date = gcal_edit_dialog_get_date_start (dialog);