Index: calendar/gui/e-day-view.c
===================================================================
--- calendar/gui/e-day-view.c	(revision 36447)
+++ calendar/gui/e-day-view.c	(working copy)
@@ -3938,7 +3938,7 @@ e_day_view_finish_long_event_resize (EDa
 		dt = day_view->day_starts[day_view->resize_start_row];
 		*date.value = icaltime_from_timet_with_zone (dt, is_date,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-		e_cal_component_set_dtstart (comp, &date);
+		cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 		e_cal_component_free_datetime (&ecdt);
 		date.tzid = NULL; /* do not reuse it later */
 	} else {
@@ -3951,7 +3951,7 @@ e_day_view_finish_long_event_resize (EDa
 		dt = day_view->day_starts[day_view->resize_end_row + 1];
 		*date.value = icaltime_from_timet_with_zone (dt, is_date,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-		e_cal_component_set_dtend (comp, &date);
+		cal_comp_set_dtend_with_oldzone (client, comp, &date);
 		e_cal_component_free_datetime (&ecdt);
 		date.tzid = NULL; /* do not reuse it later */
 	}
@@ -3969,12 +3969,12 @@ e_day_view_finish_long_event_resize (EDa
 				*date.value = icaltime_from_timet_with_zone (
 					event->comp_data->instance_end, FALSE,
 					e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-				e_cal_component_set_dtend (comp, &date);
+				cal_comp_set_dtend_with_oldzone (client, comp, &date);
 			} else {
 				*date.value = icaltime_from_timet_with_zone (
 					event->comp_data->instance_start, FALSE,
 					e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-				e_cal_component_set_dtstart (comp, &date);
+				cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 			}
 
 			e_cal_component_set_rdate_list (comp, NULL);
@@ -4034,20 +4034,18 @@ e_day_view_finish_resize (EDayView *day_
 	}
 
 	date.value = &itt;
-	/* FIXME: Should probably keep the timezone of the original start
-	   and end times. */
 	date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 
 	if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
 		dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row);
 		*date.value = icaltime_from_timet_with_zone (dt, FALSE,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-		e_cal_component_set_dtstart (comp, &date);
+		cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 	} else {
 		dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_end_row + 1);
 		*date.value = icaltime_from_timet_with_zone (dt, FALSE,
 							     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-		e_cal_component_set_dtend (comp, &date);
+		cal_comp_set_dtend_with_oldzone (client, comp, &date);
 	}
 
 	e_cal_component_commit_sequence (comp);
@@ -4078,12 +4076,12 @@ e_day_view_finish_resize (EDayView *day_
 				*date.value = icaltime_from_timet_with_zone (
 					event->comp_data->instance_end, FALSE,
 					e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-				e_cal_component_set_dtend (comp, &date);
+				cal_comp_set_dtend_with_oldzone (client, comp, &date);
 			} else {
 				*date.value = icaltime_from_timet_with_zone (
 					event->comp_data->instance_start, FALSE,
 					e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-				e_cal_component_set_dtstart (comp, &date);
+				cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 			}
 
 			e_cal_component_set_rdate_list (comp, NULL);
@@ -6065,10 +6063,10 @@ e_day_view_change_event_time (EDayView *
 
 	*date.value = icaltime_from_timet_with_zone (start_dt, FALSE,
 						     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-	e_cal_component_set_dtstart (comp, &date);
+	cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 	*date.value = icaltime_from_timet_with_zone (end_dt, FALSE,
 						     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-	e_cal_component_set_dtend (comp, &date);
+	cal_comp_set_dtend_with_oldzone (client, comp, &date);
 
 	e_cal_component_commit_sequence (comp);
 
@@ -7436,7 +7434,7 @@ e_day_view_on_top_canvas_drag_data_recei
 				   the original start and end times. */
 				date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 			}
-			e_cal_component_set_dtstart (comp, &date);
+			cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 
 			if (end_offset == 0)
 				dt = day_view->day_starts[day + num_days];
@@ -7452,7 +7450,7 @@ e_day_view_on_top_canvas_drag_data_recei
 				   the original start and end times. */
 				date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
 			}
-			e_cal_component_set_dtend (comp, &date);
+			cal_comp_set_dtend_with_oldzone (client, comp, &date);
 
 			gtk_drag_finish (context, TRUE, TRUE, time);
 
@@ -7649,11 +7647,11 @@ e_day_view_on_main_canvas_drag_data_rece
 			dt = e_day_view_convert_grid_position_to_time (day_view, day, row) + start_offset * 60;
 			*date.value = icaltime_from_timet_with_zone (dt, FALSE,
 								     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-			e_cal_component_set_dtstart (comp, &date);
+			cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 			dt = e_day_view_convert_grid_position_to_time (day_view, day, row + num_rows) - end_offset * 60;
 			*date.value = icaltime_from_timet_with_zone (dt, FALSE,
 								     e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-			e_cal_component_set_dtend (comp, &date);
+			cal_comp_set_dtend_with_oldzone (client, comp, &date);
 			e_cal_component_abort_sequence (comp);
 
 			gtk_drag_finish (context, TRUE, TRUE, time);
Index: calendar/gui/e-week-view.c
===================================================================
--- calendar/gui/e-week-view.c	(revision 36447)
+++ calendar/gui/e-week-view.c	(working copy)
@@ -3431,10 +3431,10 @@ e_week_view_change_event_time (EWeekView
 
 	*date.value = icaltime_from_timet_with_zone (start_dt, is_all_day,
 						     e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
-	e_cal_component_set_dtstart (comp, &date);
+	cal_comp_set_dtstart_with_oldzone (client, comp, &date);
 	*date.value = icaltime_from_timet_with_zone (end_dt, is_all_day,
 						     e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
-	e_cal_component_set_dtend (comp, &date);
+	cal_comp_set_dtend_with_oldzone (client, comp, &date);
 
 	e_cal_component_commit_sequence (comp);
 
Index: calendar/gui/e-calendar-view.c
===================================================================
--- calendar/gui/e-calendar-view.c	(revision 36447)
+++ calendar/gui/e-calendar-view.c	(working copy)
@@ -1587,10 +1587,10 @@ on_unrecur_appointment (EPopup *ep, EPop
 
 	*date.value = icaltime_from_timet_with_zone (event->comp_data->instance_start, FALSE,
 						     e_calendar_view_get_timezone (cal_view));
-	e_cal_component_set_dtstart (new_comp, &date);
+	cal_comp_set_dtstart_with_oldzone (client, new_comp, &date);
 	*date.value = icaltime_from_timet_with_zone (event->comp_data->instance_end, FALSE,
 						     e_calendar_view_get_timezone (cal_view));
-	e_cal_component_set_dtend (new_comp, &date);
+	cal_comp_set_dtend_with_oldzone (client, new_comp, &date);
 	e_cal_component_commit_sequence (new_comp);
 
 	/* Now update both ECalComponents. Note that we do this last since at
Index: calendar/gui/comp-util.c
===================================================================
--- calendar/gui/comp-util.c	(revision 36447)
+++ calendar/gui/comp-util.c	(working copy)
@@ -530,3 +530,80 @@ cal_comp_selection_get_string_list (GtkS
 
 	return list;
 }
+
+static void
+datetime_to_zone (ECal *client, ECalComponentDateTime *date, const char *tzid)
+{
+	icaltimezone *from, *to;
+
+	g_return_if_fail (date != NULL);
+
+	if (date->tzid == NULL || tzid == NULL ||
+	    date->tzid == tzid || g_str_equal (date->tzid, tzid))
+		return;
+
+	from = icaltimezone_get_builtin_timezone_from_tzid (date->tzid);
+	if (!from) {
+		if (!e_cal_get_timezone (client, date->tzid, &from, NULL))
+			g_warning ("%s: Could not get timezone from server: %s", G_STRFUNC, date->tzid ? date->tzid : "");
+	}
+
+	to = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+	if (!to) {
+		/* do not check failure here, maybe the zone is not available there */
+		e_cal_get_timezone (client, tzid, &to, NULL);
+	}
+
+	icaltimezone_convert_time (date->value, from, to);
+	date->tzid = tzid;
+}
+
+/**
+ * cal_comp_set_dtstart_with_oldzone:
+ * Changes 'dtstart' of the component, but converts time to the old timezone.
+ * @param client ECal structure, to retrieve timezone from, when required.
+ * @param comp Component, where make the change.
+ * @param pdate Value, to change to.
+ **/
+void
+cal_comp_set_dtstart_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate)
+{
+	ECalComponentDateTime olddate, date;
+
+	g_return_if_fail (comp != NULL);
+	g_return_if_fail (pdate != NULL);
+
+	e_cal_component_get_dtstart (comp, &olddate);
+
+	date = *pdate;
+
+	datetime_to_zone (client, &date, olddate.tzid);
+	e_cal_component_set_dtstart (comp, &date);
+
+	e_cal_component_free_datetime (&olddate);
+}
+
+/**
+ * cal_comp_set_dtend_with_oldzone:
+ * Changes 'dtend' of the component, but converts time to the old timezone.
+ * @param client ECal structure, to retrieve timezone from, when required.
+ * @param comp Component, where make the change.
+ * @param pdate Value, to change to.
+ **/
+void
+cal_comp_set_dtend_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate)
+{
+	ECalComponentDateTime olddate, date;
+
+	g_return_if_fail (comp != NULL);
+	g_return_if_fail (pdate != NULL);
+
+	e_cal_component_get_dtend (comp, &olddate);
+
+	date = *pdate;
+
+	datetime_to_zone (client, &date, olddate.tzid);
+	e_cal_component_set_dtend (comp, &date);
+
+	e_cal_component_free_datetime (&olddate);
+}
Index: calendar/gui/comp-util.h
===================================================================
--- calendar/gui/comp-util.h	(revision 36447)
+++ calendar/gui/comp-util.h	(working copy)
@@ -54,4 +54,7 @@ ECalComponent *cal_comp_memo_new_with_de
 void    cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list);
 GSList *cal_comp_selection_get_string_list (GtkSelectionData *data);
 
+void cal_comp_set_dtstart_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
+void cal_comp_set_dtend_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
+
 #endif
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 36447)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,20 @@
+2008-09-25  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #245156
+
+	* gui/e-day-view.c: (e_day_view_finish_long_event_resize),
+	(e_day_view_finish_resize), (e_day_view_change_event_time),
+	(e_day_view_on_top_canvas_drag_data_received),
+	(e_day_view_on_main_canvas_drag_data_received):
+	* gui/e-week-view.c: (e_week_view_change_event_time):
+	* gui/e-calendar-view.c: (on_unrecur_appointment):
+	Keep old timezone for dtstart/dtend when changing it.
+	* gui/comp-util.h: (cal_comp_set_dtstart_with_oldzone),
+	(cal_comp_set_dtend_with_oldzone):
+	* gui/comp-util.c: (cal_comp_set_dtstart_with_oldzone),
+	(cal_comp_set_dtend_with_oldzone), (datetime_to_zone):
+	Helper functions to make it easier.
+
 2008-09-24  Sankar P  <psankar@novell.com>
 
 License Changes
