[gnome-calendar/wip/mcatanzaro/timezone: 2/5] event: Fix changing the timezone



commit 108484b621778a791cb9ebcb06ca5cdd2b6e27ad
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Dec 5 16:34:14 2017 -0600

    event: Fix changing the timezone
    
    g_date_time_equal() corrects for timezone offsets to ensure that, e.g.,
    6 AM CST is treated as equal to 12 PM UTC. This means attempts to change
    the start and end times of events to the same time in another timezone
    are currently failing. We need to remove this attempt at optimization
    since it's not doing the right thing.

 src/gcal-event.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-event.c b/src/gcal-event.c
index 789f67c..dc61924 100644
--- a/src/gcal-event.c
+++ b/src/gcal-event.c
@@ -985,9 +985,7 @@ gcal_event_set_date_end (GcalEvent *self,
 {
   g_return_if_fail (GCAL_IS_EVENT (self));
 
-  if (self->dt_end != dt &&
-      (!self->dt_end || !dt ||
-       (self->dt_end && dt && !g_date_time_equal (self->dt_end, dt))))
+  if (self->dt_end != dt)
     {
       ECalComponentDateTime *component_dt, current;
 
@@ -1042,9 +1040,7 @@ gcal_event_set_date_start (GcalEvent *self,
 {
   g_return_if_fail (GCAL_IS_EVENT (self));
 
-  if (self->dt_start != dt &&
-      (!self->dt_start || !dt ||
-       (self->dt_start && dt && !g_date_time_equal (self->dt_start, dt))))
+  if (self->dt_start != dt)
     {
       ECalComponentDateTime *component_dt, current;
 


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