[evolution/gnome-2-32] Bug #632199 - Opening calendar from panel clock goes to previous day
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-2-32] Bug #632199 - Opening calendar from panel clock goes to previous day
- Date: Fri, 29 Oct 2010 13:56:17 +0000 (UTC)
commit 1d8b7945b5cd127da2f205d3538409ea5b044283
Author: Milan Crha <mcrha redhat com>
Date: Fri Oct 29 15:55:45 2010 +0200
Bug #632199 - Opening calendar from panel clock goes to previous day
modules/calendar/e-cal-shell-backend.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index e726263..134f706 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -451,6 +451,18 @@ cal_shell_backend_init_importers (void)
e_import_class_add_importer (import_class, importer, NULL, NULL);
}
+static time_t
+utc_to_user_zone (time_t utc_time)
+{
+ icaltimezone *zone = calendar_config_get_icaltimezone ();
+
+ if (!zone || (int) utc_time == -1)
+ return utc_time;
+
+ return icaltime_as_timet (
+ icaltime_from_timet_with_zone (utc_time, FALSE, zone));
+}
+
static gboolean
cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
const gchar *uri)
@@ -510,10 +522,10 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
content = g_strndup (cp, content_len);
if (g_ascii_strcasecmp (header, "startdate") == 0)
g_date_set_time_t (
- &start_date, time_from_isodate (content));
+ &start_date, utc_to_user_zone (time_from_isodate (content)));
else if (g_ascii_strcasecmp (header, "enddate") == 0)
g_date_set_time_t (
- &end_date, time_from_isodate (content));
+ &end_date, utc_to_user_zone (time_from_isodate (content)));
else if (g_ascii_strcasecmp (header, "source-uid") == 0)
source_uid = g_strdup (content);
else if (g_ascii_strcasecmp (header, "comp-uid") == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]