Improve cycle

This commit is contained in:
Anton Vakhrushev 2019-11-04 19:53:25 +03:00
parent a8eba4de31
commit a6d68967f7

View File

@ -130,13 +130,10 @@ module Dayoff
end
def get_work_hours
sum = 0
location = Time::Location.load("Europe/Moscow")
@wrecords.each do |wr|
@wrecords.reduce 0 do |acc, wr|
diff = wr.finish_time - wr.start_time
sum += diff.total_hours.to_i32
acc + diff.total_hours.to_i32
end
sum
end
def start(time : Time)