Index: calendar/gui/e-calendar-view.c
===================================================================
--- calendar/gui/e-calendar-view.c	(revision 33820)
+++ calendar/gui/e-calendar-view.c	(working copy)
@@ -1894,6 +1894,8 @@
  * 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)
@@ -1907,10 +1909,24 @@
 		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);
 }
 
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 33820)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2007-07-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #262226
+
+	* gui/e-calendar-view.c: (e_calendar_view_new_appointment_full):
+	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.
+
 2007-07-18  Hiroyuki Ikezoe  <poincare@ikezoe.net>
 
 	* gui/cal-search-bar.c: (cal_search_bar_construct): Remove "/" as
