Index: lib/redmine/helpers/gantt.rb
===================================================================
--- lib/redmine/helpers/gantt.rb	(revision 8026)
+++ lib/redmine/helpers/gantt.rb	(working copy)
@@ -678,7 +678,15 @@
         if x.root_id == y.root_id
           x.lft <=> y.lft
         else
-          x.root_id <=> y.root_id
+	  if x.start_date != nil and y.start_date != nil
+		x.start_date <=> y.start_date
+	  elsif x.start_date != nil
+		-1
+	  elsif y.start_date != nil
+		1
+	  else
+	        x.root_id <=> y.root_id
+          end
         end
       end
 
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb	(revision 8026)
+++ app/models/issue.rb	(working copy)
@@ -766,6 +766,26 @@
       # update former parent
       recalculate_attributes_for(former_parent_id) if former_parent_id
     end
+
+    if self.parent != nil and self.start_date
+      lesser_sibling_found = false
+      last_visited = nil
+      self.parent.children.reverse.each do |sibling|
+        if (sibling != self and sibling.start_date and sibling.start_date < self.start_date)
+          if last_visited != self
+            move_to_right_of sibling
+          end
+          lesser_sibling_found = true
+          break
+        end
+        last_visited = sibling
+      end
+
+      if self.parent.children[0] != self and not lesser_sibling_found
+        move_to_left_of(self.parent.children[0])
+      end
+    end
+
     remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
   end
 
