Guest User

Untitled

a guest
Jul 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. self.days.each do |day|
  2. if day == self.begin_date.to_date # sprint begin date, set to committed hours
  3. hours_cache = self.committed_task_hours
  4. elsif day == Time.zone.now.to_date # today, set to total hours
  5. hours_cache = self.total_task_hours
  6. else
  7. hours_cache = self.committed_task_hours
  8. day_exists_in_hours_log = !(hours_log.find {|h| h[:day] == day}).nil?
  9.  
  10. if day_exists_in_hours_log
  11. hours_log.each do |log|
  12. if log[:day] > day
  13. hours_cache += log[:hours]
  14. end
  15. end
  16. else
  17. hours_cache = nil if day > Time.zone.now.to_date
  18. end
  19. end
  20.  
  21. burndown_data.push({:day => day.to_datetime.utc.to_time, :hours => hours_cache})
  22. end
  23.  
  24. burndown_data
Add Comment
Please, Sign In to add comment