diff options
author | Damon Chaplin <damon@ximian.com> | 2001-07-03 12:21:37 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-07-03 12:21:37 +0800 |
commit | 642d32d63f226cd1ba049a9d979132e1a1cef94d (patch) | |
tree | be4ef8fb72ca41391007554a6cbe97af41533555 /calendar/cal-util/cal-component.c | |
parent | bacd3a85a434032316b3e63b95282175ce2b0659 (diff) | |
download | gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.gz gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.zst gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.zip |
cal-client/cal-client.[hc] cal-util/cal-component.c
2001-07-03 Damon Chaplin <damon@ximian.com>
* cal-client/cal-client.[hc]
* cal-util/cal-component.c
* cal-util/cal-recur.[hc]
* cal-util/test-recur.c
* cal-util/timeutil.c
* gui/calendar-config.c
* gui/calendar-model.[hc]
* gui/comp-util.[hc]
* gui/e-calendar-table.c
* gui/e-day-view-main-item.c
* gui/e-day-view-top-item.c
* gui/e-day-view.[hc]
* gui/e-itip-control.c
* gui/e-timezone-entry.[hc]
* gui/e-week-view.[hc]
* gui/gnome-cal.[hc]
* gui/goto.c
* gui/tag-calendar.[hc]
* gui/dialogs/cal-prefs-dialog.c
* gui/dialogs/comp-editor-page.[hc]
* gui/dialogs/comp-editor-util.[hc]
* gui/dialogs/comp-editor.c
* gui/dialogs/e-timezone-dialog.[hc]
* gui/dialogs/event-page.c
* gui/dialogs/meeting-page.c
* gui/dialogs/recurrence-page.c
* gui/dialogs/task-details-page.c
* gui/dialogs/task-details-page.glade
* gui/dialogs/task-page.c
* idl/evolution-calendar.idl
* pcs/cal-backend-file.c
* pcs/cal-backend.c
* pcs/cal-backend.h
* pcs/cal.c
* pcs/query.c: timezone changes everywhere. There's still quite a
few things to update, and its not working well at present.
svn path=/trunk/; revision=10729
Diffstat (limited to 'calendar/cal-util/cal-component.c')
-rw-r--r-- | calendar/cal-util/cal-component.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index 36c6408d59..2669dc5562 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -883,7 +883,7 @@ ensure_mandatory_properties (CalComponent *comp) struct icaltimetype t; tim = time (NULL); - t = icaltime_from_timet (tim, FALSE); + t = icaltime_from_timet_with_zone (tim, FALSE, icaltimezone_get_utc_timezone ()); priv->dtstamp = icalproperty_new_dtstamp (t); icalcomponent_add_property (priv->icalcomp, priv->dtstamp); @@ -1822,8 +1822,12 @@ get_datetime (struct datetime *datetime, } else dt->value = NULL; + /* If the icaltimetype has is_utc set, we set "UTC" as the TZID. + This makes the timezone code simpler. */ if (datetime->tzid_param) dt->tzid = icalparameter_get_tzid (datetime->tzid_param); + else if (dt->value && dt->value->is_utc) + dt->tzid = "UTC"; else dt->tzid = NULL; } @@ -1853,6 +1857,10 @@ set_datetime (CalComponent *comp, struct datetime *datetime, g_return_if_fail (dt->value != NULL); + /* If the TZID is set to "UTC", we set the is_utc flag. */ + if (dt->tzid && !strcmp (dt->tzid, "UTC")) + dt->value->is_utc = 1; + if (datetime->prop) (* prop_set_func) (datetime->prop, *dt->value); else { @@ -1860,7 +1868,8 @@ set_datetime (CalComponent *comp, struct datetime *datetime, icalcomponent_add_property (priv->icalcomp, datetime->prop); } - if (dt->tzid) { + /* If the TZID is set to "UTC", we don't want to save the TZID. */ + if (dt->tzid && strcmp (dt->tzid, "UTC")) { g_assert (datetime->prop != NULL); if (datetime->tzid_param) |