[gnome-calendar] views: ensure initial/final dates have timezones
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] views: ensure initial/final dates have timezones
- Date: Thu, 4 Dec 2014 22:32:10 +0000 (UTC)
commit 48f5b36c298c5f6a0e635b38ed14d612f3b46964
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Fri Sep 26 12:44:38 2014 -0400
views: ensure initial/final dates have timezones
src/gcal-month-view.c | 9 +++++++++
src/gcal-week-view.c | 12 ++++++++++--
src/gcal-window.c | 4 +++-
src/gcal-year-view.c | 8 ++++++++
4 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 97adfd9..2663d67 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -1128,6 +1128,10 @@ gcal_month_view_get_initial_date (GcalView *view)
new_date = gcal_dup_icaltime (priv->date);
new_date->day = 1;
+ new_date->is_date = 0;
+ new_date->hour = 0;
+ new_date->minute = 0;
+ new_date->second = 0;
return new_date;
}
@@ -1151,6 +1155,11 @@ gcal_month_view_get_final_date (GcalView *view)
new_date = gcal_dup_icaltime (priv->date);
new_date->day = icaltime_days_in_month (priv->date->month, priv->date->year);
+ new_date->is_date = 0;
+ new_date->hour = 23;
+ new_date->minute = 59;
+ new_date->second = 0;
+
return new_date;
}
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index f95aa7d..9aa5d43 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -1278,7 +1278,11 @@ gcal_week_view_get_initial_date (GcalView *view)
*new_date = icaltime_from_day_of_year (
icaltime_day_of_year (*(priv->date)) - icaltime_day_of_week (*(priv->date)) + 1,
priv->date->year);
-
+ new_date->is_date = 0;
+ new_date->hour = 0;
+ new_date->minute = 0;
+ new_date->second = 0;
+ *new_date = icaltime_set_timezone (new_date, priv->date->zone);
return new_date;
}
@@ -1301,7 +1305,11 @@ gcal_week_view_get_final_date (GcalView *view)
*new_date = icaltime_from_day_of_year (
icaltime_day_of_year (*(priv->date)) + 7 - icaltime_day_of_week (*(priv->date)),
priv->date->year);
-
+ new_date->is_date = 0;
+ new_date->hour = 23;
+ new_date->minute = 59;
+ new_date->second = 0;
+ *new_date = icaltime_set_timezone (new_date, priv->date->zone);
return new_date;
}
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 47cc1dc..d14f328 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1597,7 +1597,9 @@ gcal_window_new_with_view (GcalApplication *app,
manager = gcal_application_get_manager (GCAL_APPLICATION (app));
/* FIXME: here read the initial date from somewehere */
- date = icaltime_current_time_with_zone (gcal_manager_get_system_timezone (manager));
+ date = icaltime_from_timet (time(NULL), 0);
+ date = icaltime_set_timezone (&date,
+ gcal_manager_get_system_timezone (manager));
win = g_object_new (GCAL_TYPE_WINDOW,
"application",
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 619aefe..90358b3 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -882,6 +882,10 @@ gcal_year_view_get_initial_date (GcalView *view)
new_date = gcal_dup_icaltime (priv->date);
new_date->day = 1;
new_date->month = 1;
+ new_date->is_date = 0;
+ new_date->hour = 0;
+ new_date->minute = 0;
+ new_date->second = 0;
return new_date;
}
@@ -906,6 +910,10 @@ gcal_year_view_get_final_date (GcalView *view)
new_date = gcal_dup_icaltime (priv->date);
new_date->day = 31;
new_date->month = 12;
+ new_date->is_date = 0;
+ new_date->hour = 23;
+ new_date->minute = 59;
+ new_date->second = 0;
return new_date;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]