Defect #5822 » Redmine_Datetime_Patch.patch
| lib/redmine/helpers/calendar.rb (working copy) | ||
|---|---|---|
|
# Sets calendar events
|
||
|
def events=(events)
|
||
|
@events = events
|
||
|
@ending_events_by_days = @events.group_by {|event| event.due_date}
|
||
|
@starting_events_by_days = @events.group_by {|event| event.start_date}
|
||
|
@ending_events_by_days = @events.group_by {|event| event.due_date ? event.due_date.to_date() : nil}
|
||
|
@starting_events_by_days = @events.group_by {|event| event.start_date ? event.start_date.to_date() : nil}
|
||
|
end
|
||
|
|
||
|
# Returns events for the given day
|
||
| lib/redmine/helpers/gantt.rb (working copy) | ||
|---|---|---|
|
case options[:format]
|
||
|
when :html
|
||
|
output = ''
|
||
|
i_left = ((project.start_date - self.date_from)*options[:zoom]).floor
|
||
|
i_left = ((project.start_date.to_date - self.date_from)*options[:zoom]).floor
|
||
|
start_date = project.start_date
|
||
|
start_date = project.start_date.to_date
|
||
|
start_date ||= self.date_from
|
||
|
start_left = ((start_date - self.date_from)*options[:zoom]).floor
|
||
|
i_end_date = ((project.due_date <= self.date_to) ? project.due_date : self.date_to )
|
||
|
i_done_date = start_date + ((project.due_date - start_date+1)* project.completed_percent(:include_subprojects => true)/100).floor
|
||
|
i_end_date = ((project.due_date.to_date <= self.date_to) ? project.due_date.to_date : self.date_to )
|
||
|
i_done_date = start_date + ((project.due_date.to_date - start_date+1)* project.completed_percent(:include_subprojects => true)/100).floor
|
||
|
i_done_date = (i_done_date <= self.date_from ? self.date_from : i_done_date )
|
||
|
i_done_date = (i_done_date >= self.date_to ? self.date_to : i_done_date )
|
||
|
|
||
| ... | ... | |
|
output
|
||
|
when :image
|
||
|
options[:image].stroke('transparent')
|
||
|
i_left = options[:subject_width] + ((project.due_date - self.date_from)*options[:zoom]).floor
|
||
|
i_left = options[:subject_width] + ((project.due_date.to_date - self.date_from)*options[:zoom]).floor
|
||
|
# Make sure negative i_left doesn't overflow the subject
|
||
|
if i_left > options[:subject_width]
|
||
| ... | ... | |
|
end
|
||
|
when :pdf
|
||
|
options[:pdf].SetY(options[:top]+1.5)
|
||
|
i_left = ((project.due_date - @date_from)*options[:zoom])
|
||
|
i_left = ((project.due_date.to_date - @date_from)*options[:zoom])
|
||
|
# Make sure negative i_left doesn't overflow the subject
|
||
|
if i_left > 0
|
||
| ... | ... | |
|
case options[:format]
|
||
|
when :html
|
||
|
output = ''
|
||
|
i_left = ((version.start_date - self.date_from)*options[:zoom]).floor
|
||
|
i_left = ((version.start_date.to_date - self.date_from)*options[:zoom]).floor
|
||
|
# TODO: or version.fixed_issues.collect(&:start_date).min
|
||
|
start_date = version.fixed_issues.minimum('start_date') if version.fixed_issues.present?
|
||
|
start_date ||= self.date_from
|
||
|
start_date = start_date.to_date
|
||
|
start_left = ((start_date - self.date_from)*options[:zoom]).floor
|
||
|
i_end_date = ((version.due_date <= self.date_to) ? version.due_date : self.date_to )
|
||
|
i_done_date = start_date + ((version.due_date - start_date+1)* version.completed_pourcent/100).floor
|
||
|
i_end_date = ((version.due_date.to_date <= self.date_to) ? version.due_date.to_date : self.date_to )
|
||
|
i_done_date = start_date + ((version.due_date.to_date - start_date+1)* version.completed_pourcent/100).floor
|
||
|
i_done_date = (i_done_date <= self.date_from ? self.date_from : i_done_date )
|
||
|
i_done_date = (i_done_date >= self.date_to ? self.date_to : i_done_date )
|
||
|
|
||
| ... | ... | |
|
output
|
||
|
when :image
|
||
|
options[:image].stroke('transparent')
|
||
|
i_left = options[:subject_width] + ((version.start_date - @date_from)*options[:zoom]).floor
|
||
|
i_left = options[:subject_width] + ((version.start_date.to_date - @date_from)*options[:zoom]).floor
|
||
|
# Make sure negative i_left doesn't overflow the subject
|
||
|
if i_left > options[:subject_width]
|
||
| ... | ... | |
|
end
|
||
|
when :pdf
|
||
|
options[:pdf].SetY(options[:top]+1.5)
|
||
|
i_left = ((version.start_date - @date_from)*options[:zoom])
|
||
|
i_left = ((version.start_date.to_date - @date_from)*options[:zoom])
|
||
|
# Make sure negative i_left doesn't overflow the subject
|
||
|
if i_left > 0
|
||
| ... | ... | |
|
output = ''
|
||
|
# Handle nil start_dates, rare but can happen.
|
||
|
i_start_date = if issue.start_date && issue.start_date >= self.date_from
|
||
|
issue.start_date
|
||
|
issue.start_date.to_date
|
||
|
else
|
||
|
self.date_from
|
||
|
end
|
||
|
i_end_date = ((issue.due_before && issue.due_before <= self.date_to) ? issue.due_before : self.date_to )
|
||
|
i_done_date = i_start_date + ((issue.due_before - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_end_date = ((issue.due_before.to_date && issue.due_before.to_date <= self.date_to) ? issue.due_before.to_date : self.date_to )
|
||
|
debugger
|
||
|
i_done_date = i_start_date + ((issue.due_before.to_date - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_done_date = (i_done_date <= self.date_from ? self.date_from : i_done_date )
|
||
|
i_done_date = (i_done_date >= self.date_to ? self.date_to : i_done_date )
|
||
|
|
||
| ... | ... | |
|
@date_from
|
||
|
end
|
||
|
i_end_date = (issue.due_before <= date_to ? issue.due_before : date_to )
|
||
|
i_done_date = i_start_date + ((issue.due_before - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_end_date = (issue.due_before.to_date <= date_to ? issue.due_before.to_date : date_to )
|
||
|
i_done_date = i_start_date + ((issue.due_before.to_date - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
|
||
|
i_done_date = (i_done_date >= date_to ? date_to : i_done_date )
|
||
|
i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
|
||
| ... | ... | |
|
@date_from
|
||
|
end
|
||
|
i_end_date = (issue.due_before <= @date_to ? issue.due_before : @date_to )
|
||
|
i_end_date = (issue.due_before.to_date <= @date_to ? issue.due_before.to_date : @date_to )
|
||
|
|
||
|
i_done_date = i_start_date + ((issue.due_before - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_done_date = i_start_date + ((issue.due_before.to_date - i_start_date+1)*issue.done_ratio/100).floor
|
||
|
i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
|
||
|
i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
|
||
|
|
||