[gnome-calendar] window: fix start & end ranges



commit 710ee5fc8fb2036feaba2c399ff8e5043c88de74
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Feb 17 18:57:14 2016 +0100

    window: fix start & end ranges
    
    When we apply a timezone, the ranges change. Therefore, we
    should set the timezone to the date itself and then get the
    range.

 src/gcal-window.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 8cd8b98..32a965f 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -367,13 +367,12 @@ update_active_date (GcalWindow   *window,
       date.minute = 0;
       date.second = 0;
       date.is_date = 0;
-      range_start = icaltime_as_timet_with_zone (date, default_zone);
+      date.zone = default_zone;
+      range_start = icaltime_as_timet (date);
 
-      date.day = 31;
-      date.month = 12;
-      date.hour = 23;
-      date.minute = 59;
-      range_end = icaltime_as_timet_with_zone (date, default_zone);
+      date.year++;
+      date = icaltime_normalize (date);
+      range_end = icaltime_as_timet (date);
 
       gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->year_view), 
range_start, range_end);
     }
@@ -387,12 +386,12 @@ update_active_date (GcalWindow   *window,
       date.minute = 0;
       date.second = 0;
       date.is_date = 0;
-      range_start = icaltime_as_timet_with_zone (date, default_zone);
+      date.zone = default_zone;
+      range_start = icaltime_as_timet (date);
 
-      date.day = time_days_in_month (new_date->year, new_date->month - 1);
-      date.hour = 23;
-      date.minute = 59;
-      range_end = icaltime_as_timet_with_zone (date, default_zone);
+      date.month++;
+      date = icaltime_normalize (date);
+      range_end = icaltime_as_timet (date);
 
       gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->month_view), 
range_start, range_end);
     }


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