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 end
def get_work_hours def get_work_hours
sum = 0 @wrecords.reduce 0 do |acc, wr|
location = Time::Location.load("Europe/Moscow")
@wrecords.each do |wr|
diff = wr.finish_time - wr.start_time diff = wr.finish_time - wr.start_time
sum += diff.total_hours.to_i32 acc + diff.total_hours.to_i32
end end
sum
end end
def start(time : Time) def start(time : Time)