]> source.dussan.org Git - redmine.git/commitdiff
Merged r17656 and r17657 to 3.4-stable (#29918).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 29 Nov 2018 19:11:59 +0000 (19:11 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 29 Nov 2018 19:11:59 +0000 (19:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17663 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/issues_helper.rb
test/functional/issues_controller_test.rb

index fe3d81a0a16f2a1eb40be5c4c17ab1c4728dc132..181907e4d3e53fa7f57a01c7fe574f0420461f5c 100644 (file)
@@ -127,8 +127,8 @@ module IssuesHelper
              content_tag('td', check_box_tag("ids[]", other_issue.id, false, :id => nil), :class => 'checkbox') +
              content_tag('td', relation.to_s(@issue) {|other| link_to_issue(other, :project => Setting.cross_project_issue_relations?)}.html_safe, :class => 'subject', :style => 'width: 50%') +
              content_tag('td', other_issue.status, :class => 'status') +
-             content_tag('td', other_issue.start_date, :class => 'start_date') +
-             content_tag('td', other_issue.due_date, :class => 'due_date') +
+             content_tag('td', format_date(other_issue.start_date), :class => 'start_date') +
+             content_tag('td', format_date(other_issue.due_date), :class => 'due_date') +
              content_tag('td', other_issue.disabled_core_fields.include?('done_ratio') ? '' : progress_bar(other_issue.done_ratio), :class=> 'done_ratio') +
              content_tag('td', link, :class => 'buttons'),
              :id => "relation-#{relation.id}",
index a7664c048ca952477223c35ed01a8a7899993690..74f5e8ef5b6a7f50006c29d4db51cbebddea870d 100644 (file)
@@ -1754,6 +1754,21 @@ class IssuesControllerTest < Redmine::ControllerTest
     assert_response :success
   end
 
+  def test_show_should_format_related_issues_dates
+    with_settings :date_format => '%d/%m/%Y' do
+      issue = Issue.generate!(:start_date => '2018-11-29', :due_date => '2018-12-01')
+      IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => issue, :relation_type => 'relates')
+  
+      get :show, :params => {
+          :id => 1
+        }
+      assert_response :success
+  
+      assert_select '#relations td.start_date', :text => '29/11/2018'
+      assert_select '#relations td.due_date', :text => '01/12/2018'
+    end
+  end
+
   def test_show_should_not_disclose_relations_to_invisible_issues
     Setting.cross_project_issue_relations = '1'
     IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => Issue.find(2), :relation_type => 'relates')