From 8612fa2fc136bc869151c2243e0eddcfd3274b0d Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Sat, 10 Mar 2012 15:10:32 +0000 Subject: [PATCH] Fixed Gantt months/weeks/days headers display with Ruby 1.9. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9175 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/gantts/show.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 30890280b..66890b123 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -49,7 +49,7 @@ if @gantt.zoom > 1 end # Width of the entire chart -g_width = (@gantt.date_to - @gantt.date_from + 1) * zoom +g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) @@ -89,7 +89,7 @@ month_f = @gantt.date_from left = 0 height = (show_weeks ? header_heigth : header_heigth + g_height) @gantt.months.times do - width = ((month_f >> 1) - month_f) * zoom - 1 + width = (((month_f >> 1) - month_f) * zoom - 1).to_i %>
<%= link_to h("#{month_f.year}-#{month_f.month}"), @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_name(month_f.month)} #{month_f.year}"%> @@ -107,10 +107,10 @@ if show_weeks left = 0 height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height) if @gantt.date_from.cwday == 1 - # @date_from is monday - week_f = @gantt.date_from + # @date_from is monday + week_f = @gantt.date_from else - # find next monday after @date_from + # find next monday after @date_from week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 %> @@ -120,7 +120,7 @@ if show_weeks end %> <% while week_f <= @gantt.date_to - width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1 + width = ((week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1).to_i %>
<%= week_f.cweek if width >= 16 %> @@ -159,7 +159,7 @@ end %> # Today red line (excluded from cache) # if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> -
 
+
 
<% end %>
-- 2.39.5