]> source.dussan.org Git - redmine.git/commitdiff
Merged r19976 from trunk to 4.1-stable (#33175).
authorGo MAEDA <maeda@farend.jp>
Sat, 15 Aug 2020 23:03:13 +0000 (23:03 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 15 Aug 2020 23:03:13 +0000 (23:03 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19980 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/helpers/gantt.rb
test/unit/lib/redmine/helpers/gantt_test.rb

index 1b308ed217730b463e323da9722caaf6aa735c00..5c8be8db8a8f98b5b88a6bf7b8a27905d610ce59 100644 (file)
@@ -624,13 +624,13 @@ module Redmine
         zoom ||= @zoom
         coords = {}
         if start_date && end_date && start_date <= self.date_to && end_date >= self.date_from
-          if start_date > self.date_from
+          if start_date >= self.date_from
             coords[:start] = start_date - self.date_from
             coords[:bar_start] = start_date - self.date_from
           else
             coords[:bar_start] = 0
           end
-          if end_date < self.date_to
+          if end_date <= self.date_to
             coords[:end] = end_date - self.date_from + 1
             coords[:bar_end] = end_date - self.date_from + 1
           else
index 3b1f8f7fba445d34a6c0b783f7628ccc3b37a0d0..3370817e8ec886818ec10e632aa5a01a6044b242 100644 (file)
@@ -450,6 +450,9 @@ class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest
     @output_buffer = @gantt.line(today - 7, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
     assert_select "div.starting", 1
     assert_select 'div.starting[style*="left:28px"]', 1
+    # starting marker on the leftmost boundary of the gantt
+    @output_buffer = @gantt.line(gantt_start, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
+    assert_select 'div.starting[style*="left:0px"]', 1
   end
 
   test "#line starting marker should not appear if the start date is before gantt start date" do
@@ -463,6 +466,9 @@ class Redmine::Helpers::GanttHelperTest < Redmine::HelperTest
     @output_buffer = @gantt.line(today - 7, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
     assert_select "div.ending", 1
     assert_select 'div.ending[style*="left:88px"]', 1
+    # ending marker on the rightmost boundary of the gantt
+    @output_buffer = @gantt.line(today - 7, gantt_end, 30, true, 'line', :format => :html, :zoom => 4)
+    assert_select 'div.ending[style*="left:116px"]', 1
   end
 
   test "#line ending marker should not appear if the end date is before gantt start date" do