Index: calendar/gui/e-week-view.c
===================================================================
--- calendar/gui/e-week-view.c	(revision 34008)
+++ calendar/gui/e-week-view.c	(working copy)
@@ -2061,7 +2061,7 @@
 		return FALSE;
 
 	if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
-		e_calendar_view_new_appointment_full (E_CALENDAR_VIEW (week_view), TRUE, FALSE, FALSE);
+		e_calendar_view_new_appointment_full (E_CALENDAR_VIEW (week_view), FALSE, FALSE);
 		return TRUE;
 	}
 
Index: calendar/gui/e-calendar-view.c
===================================================================
--- calendar/gui/e-calendar-view.c	(revision 34008)
+++ calendar/gui/e-calendar-view.c	(working copy)
@@ -1145,7 +1145,7 @@
 {
 	ECalendarView *cal_view = data;
 
-	e_calendar_view_new_appointment_full (cal_view, TRUE, FALSE, FALSE);
+	e_calendar_view_new_appointment_full (cal_view, TRUE, FALSE);
 }
 
 static void
@@ -1153,7 +1153,7 @@
 {
 	ECalendarView *cal_view = data;
 
-	e_calendar_view_new_appointment_full (cal_view, FALSE, TRUE, FALSE);
+	e_calendar_view_new_appointment_full (cal_view, FALSE, TRUE);
 }
 
 static void
@@ -1893,24 +1893,38 @@
  * start and end times are set to the currently selected time range in
  * the calendar view.
  *
- * With @actual_day set to TRUE, there will be always used actual day.
+ * When the selection is for all day and we don't need @all_day event,
+ * then this do a rounding to the actual hour in selected day.
  */
 void
-e_calendar_view_new_appointment_full (ECalendarView *cal_view, gboolean all_day, gboolean meeting, gboolean actual_day)
+e_calendar_view_new_appointment_full (ECalendarView *cal_view, gboolean all_day, gboolean meeting)
 {
 	time_t dtstart, dtend;
 
 	g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
 
-	if (actual_day ||
-	    !e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend)) {
+	if (!e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend)) {
 		dtstart = time (NULL);
 		dtend = dtstart + 3600;
 	}
-	/* FIXME This is a rough hack to make sure "all day" is set for */
-	if ((dtend - dtstart) % (60 * 60 * 24) == 0)
-		all_day = TRUE;
-	
+
+	/* We don't want to set all_day for this, we will rather use actual time in this cases */
+	/* dtstart should be a midnight in this case */
+	if (!all_day && (dtend - dtstart) % (60 * 60 * 24) == 0) {
+		time_t tmp = time (NULL);
+		struct tm *local = localtime (&tmp);
+		int mins = local->tm_min;
+		int time_div = calendar_config_get_time_divisions ();
+
+		/* round minutes to nearest time division, up or down */
+		if ((mins % time_div) >= time_div / 2)
+			mins += time_div;
+		mins = (mins - (mins % time_div));
+
+		dtstart = dtstart + (60 * 60 * local->tm_hour) + (mins * 60);
+		dtend = dtstart + (time_div * 60);
+	}
+
 	e_calendar_view_new_appointment_for (cal_view, dtstart, dtend, all_day, meeting);
 }
 
@@ -1919,7 +1933,7 @@
 {
 	g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
 
-	e_calendar_view_new_appointment_full (cal_view, FALSE, FALSE, FALSE);
+	e_calendar_view_new_appointment_full (cal_view, FALSE, FALSE);
 }
 
 /* Ensures the calendar is selected */
Index: calendar/gui/e-calendar-view.h
===================================================================
--- calendar/gui/e-calendar-view.h	(revision 34008)
+++ calendar/gui/e-calendar-view.h	(working copy)
@@ -152,8 +152,7 @@
 						    gboolean meeting);
 void           e_calendar_view_new_appointment_full (ECalendarView *cal_view,
 						     gboolean all_day,
-						     gboolean meeting,
-						     gboolean actual_day);
+						     gboolean meeting);
 void           e_calendar_view_new_appointment (ECalendarView *cal_view);
 void           e_calendar_view_edit_appointment (ECalendarView *cal_view,
 					    ECal *client,
Index: calendar/gui/calendar-component.c
===================================================================
--- calendar/gui/calendar-component.c	(revision 34008)
+++ calendar/gui/calendar-component.c	(working copy)
@@ -1267,16 +1267,7 @@
 		return FALSE;
 
 	if (component_view && (view = E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (component_view->calendar)))) {
-		GnomeCalendarViewType view_type;
-
-		/* Force all for these view types because thats what's selected and it mimics a double click */
-		view_type = gnome_calendar_get_view (component_view->calendar);
-		if (view_type == GNOME_CAL_WEEK_VIEW 
-		    || view_type == GNOME_CAL_MONTH_VIEW
-		    || view_type == GNOME_CAL_LIST_VIEW)
-			is_allday = TRUE;
-
-		e_calendar_view_new_appointment_full (view, is_allday, is_meeting, TRUE);
+		e_calendar_view_new_appointment_full (view, is_allday, is_meeting);
 	} else {
 		ECalComponent *comp;
 		EventEditor *editor;
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 34008)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,20 @@
+2007-08-16  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #262226
+
+	* gui/e-calendar-view.h:
+	* gui/e-calendar-view.c: (e_calendar_view_new_appointment_full):
+	Removed parameter 'actual_day', reverted changes from bug #321741.
+	This new approach will keep behavior better consistent:
+	When don't need all_day event and there are 24 hours selected, then
+	change start/end to actual time in selected day, instead of setting
+	all_day event to TRUE.
+	* gui/e-calendar-view.c: (on_new_event), (on_new_meeting),
+	(e_calendar_view_new_appointment):
+	* gui/calendar-component.c: (create_new_event):
+	* gui/e-week-view.c: (e_week_view_on_button_press):
+	Changing call of 'e_calendar_view_new_appointment_full'.
+
 2007-08-13  Suman Manjunath  <msuman@novell.com>
 
 	reviewed by: Chenthill Palanisamy  <pchenthill@novell.com>
