@@ -49,7 +49,7 if @gantt.zoom > 1 | |||
|
49 | 49 | end |
|
50 | 50 | |
|
51 | 51 | # Width of the entire chart |
|
52 | g_width = (@gantt.date_to - @gantt.date_from + 1) * zoom | |
|
52 | g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i | |
|
53 | 53 | |
|
54 | 54 | @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width) |
|
55 | 55 | |
@@ -89,7 +89,7 month_f = @gantt.date_from | |||
|
89 | 89 | left = 0 |
|
90 | 90 | height = (show_weeks ? header_heigth : header_heigth + g_height) |
|
91 | 91 | @gantt.months.times do |
|
92 | width = ((month_f >> 1) - month_f) * zoom - 1 | |
|
92 | width = (((month_f >> 1) - month_f) * zoom - 1).to_i | |
|
93 | 93 | %> |
|
94 | 94 | <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
95 | 95 | <%= 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 | |||
|
107 | 107 | left = 0 |
|
108 | 108 | height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height) |
|
109 | 109 | if @gantt.date_from.cwday == 1 |
|
110 |
|
|
|
111 |
|
|
|
110 | # @date_from is monday | |
|
111 | week_f = @gantt.date_from | |
|
112 | 112 | else |
|
113 |
|
|
|
113 | # find next monday after @date_from | |
|
114 | 114 | week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1) |
|
115 | 115 | width = (7 - @gantt.date_from.cwday + 1) * zoom - 1 |
|
116 | 116 | %> |
@@ -120,7 +120,7 if show_weeks | |||
|
120 | 120 | end %> |
|
121 | 121 | <% |
|
122 | 122 | while week_f <= @gantt.date_to |
|
123 | width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1 | |
|
123 | width = ((week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1).to_i | |
|
124 | 124 | %> |
|
125 | 125 | <div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr"> |
|
126 | 126 | <small><%= week_f.cweek if width >= 16 %></small> |
@@ -159,7 +159,7 end %> | |||
|
159 | 159 | # Today red line (excluded from cache) |
|
160 | 160 | # |
|
161 | 161 | if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %> |
|
162 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today - @gantt.date_from + 1) * zoom).floor() - 1 %>px;width:10px;border-left: 1px dashed red;"> </div> | |
|
162 | <div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i %>px;width:10px;border-left: 1px dashed red;"> </div> | |
|
163 | 163 | <% end %> |
|
164 | 164 | |
|
165 | 165 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now