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.
This commit is contained in:
Georges Basile Stavracas Neto
2016-02-17 19:00:07 +01:00
parent 093e9fa52f
commit 710ee5fc8f
+10 -11
View File
@@ -367,13 +367,12 @@ update_active_date (GcalWindow *window,
date.minute = 0; date.minute = 0;
date.second = 0; date.second = 0;
date.is_date = 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.year++;
date.month = 12; date = icaltime_normalize (date);
date.hour = 23; range_end = icaltime_as_timet (date);
date.minute = 59;
range_end = icaltime_as_timet_with_zone (date, default_zone);
gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->year_view), range_start, range_end); 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.minute = 0;
date.second = 0; date.second = 0;
date.is_date = 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.month++;
date.hour = 23; date = icaltime_normalize (date);
date.minute = 59; range_end = icaltime_as_timet (date);
range_end = icaltime_as_timet_with_zone (date, default_zone);
gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->month_view), range_start, range_end); gcal_manager_set_subscriber (window->manager, E_CAL_DATA_MODEL_SUBSCRIBER (window->month_view), range_start, range_end);
} }