[gnome-calendar] window: set the correct date range for week view



commit 8102912541883c5772f81d0875e0366e2cd5c7e1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Mar 15 00:02:17 2017 +0530

    window: set the correct date range for week view
    
    Previous commits broke the week view's date range (more
    than it was already broken). This patch fixes that by
    using the correct method to get the week start.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779967

 src/gcal-window.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index b44af8f..0800f40 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -414,15 +414,10 @@ update_active_date (GcalWindow   *window,
       !g_date_valid (&old_week) ||
       g_date_get_iso8601_week_of_year (&old_week) != g_date_get_iso8601_week_of_year (&new_week))
     {
-      gint offset;
-
-      date_start = g_date_time_new_local (new_date->year, new_date->month, new_date->day, 0, 0, 0);
-      offset = g_date_time_get_day_of_week (date_start) % 7 + get_first_weekday ();
-
-      date_start = g_date_time_add_days (date_start, offset);
+      date_start = get_start_of_week (new_date);
       range_start = g_date_time_to_unix (date_start);
 
-      date_end = g_date_time_add_days (date_start, 7);
+      date_end = get_end_of_week (new_date);
       range_end = g_date_time_to_unix (date_end);
 
       gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->week_view), 
range_start, range_end);


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