[gnome-calendar] time: properly set time and timezone
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] time: properly set time and timezone
- Date: Thu, 4 Dec 2014 22:33:11 +0000 (UTC)
commit 27565d487eb5ecb9147525fbc6eca2e24702d395
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Sep 29 01:12:50 2014 -0400
time: properly set time and timezone
src/gcal-manager.c | 12 ++++++++++--
src/gcal-window.c | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 191e3b5..a8c75f9 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -276,6 +276,12 @@ gcal_manager_init (GcalManager *self)
0,
priv->system_timezone);
+ /* setting timezones */
+ *(priv->initial_date) = icaltime_set_timezone (priv->initial_date,
+ priv->system_timezone);
+ *(priv->final_date) = icaltime_set_timezone (priv->final_date,
+ priv->system_timezone);
+
priv->clients = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
@@ -1266,10 +1272,12 @@ gcal_manager_set_new_range (GcalManager *manager,
else
{
gchar* since_iso8601 =
- isodate_from_time_t (icaltime_as_timet (*(priv->initial_date)));
+ isodate_from_time_t (icaltime_as_timet_with_zone (*(priv->initial_date),
+ priv->system_timezone));
gchar* until_iso8601 =
- isodate_from_time_t (icaltime_as_timet (*(priv->final_date)));
+ isodate_from_time_t (icaltime_as_timet_with_zone (*(priv->final_date),
+ priv->system_timezone));
g_debug ("fake-events-added between \"%s\" and \"%s\")",
since_iso8601,
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 21ada7c..137d74c 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1577,7 +1577,7 @@ 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_from_timet (time(NULL), 0);
+ date = icaltime_current_time_with_zone (gcal_manager_get_system_timezone (manager));
date = icaltime_set_timezone (&date,
gcal_manager_get_system_timezone (manager));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]