33175-r19958.patch

Go MAEDA, 2020-08-09 09:17

Download (2.28 KB)

View differences:

lib/redmine/helpers/gantt.rb
615 615
        zoom ||= @zoom
616 616
        coords = {}
617 617
        if start_date && end_date && start_date <= self.date_to && end_date >= self.date_from
618
          if start_date > self.date_from
618
          if start_date >= self.date_from
619 619
            coords[:start] = start_date - self.date_from
620 620
            coords[:bar_start] = start_date - self.date_from
621 621
          else
622 622
            coords[:bar_start] = 0
623 623
          end
624
          if end_date < self.date_to
624
          if end_date <= self.date_to
625 625
            coords[:end] = end_date - self.date_from + 1
626 626
            coords[:bar_end] = end_date - self.date_from + 1
627 627
          else
test/unit/lib/redmine/helpers/gantt_test.rb
448 448
  test "#line starting marker should appear at the start date" do
449 449
    create_gantt
450 450
    @output_buffer = @gantt.line(today - 7, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
451
    assert_select "div.starting", 1
452 451
    assert_select 'div.starting[style*="left:28px"]', 1
452
    @output_buffer = @gantt.line(gantt_start, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
453
    assert_select 'div.starting[style*="left:0px"]', 1
453 454
  end
454 455

  
455 456
  test "#line starting marker should not appear if the start date is before gantt start date" do
......
461 462
  test "#line ending marker should appear at the end date" do
462 463
    create_gantt
463 464
    @output_buffer = @gantt.line(today - 7, today + 7, 30, true, 'line', :format => :html, :zoom => 4)
464
    assert_select "div.ending", 1
465 465
    assert_select 'div.ending[style*="left:88px"]', 1
466
    @output_buffer = @gantt.line(today - 7, gantt_end, 30, true, 'line', :format => :html, :zoom => 4)
467
    assert_select 'div.ending[style*="left:116px"]', 1
466 468
  end
467 469

  
468 470
  test "#line ending marker should not appear if the end date is before gantt start date" do