Improve cycle
This commit is contained in:
parent
a8eba4de31
commit
a6d68967f7
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user