[gnome-calendar] edit-dialog: set UTC timezone when event is all day



commit e5cd5ba7f5f8ef78dfdc4b9c64f85d3e1ba4d648
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Feb 18 04:02:37 2016 +0100

    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 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 2d707ec..deb0988 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]