Fix bug.
This commit is contained in:
parent
352cd5cbbc
commit
c8a3d29a23
|
@ -136,6 +136,15 @@ class RulingTimerTemp
|
||||||
end
|
end
|
||||||
return last_work_time
|
return last_work_time
|
||||||
end
|
end
|
||||||
|
def get_first_work_time
|
||||||
|
first_work_time = self.work_times.first
|
||||||
|
if first_work_time.nil?
|
||||||
|
first_work_time = DateTime.now.utc.new_offset(self.time_offset)
|
||||||
|
else
|
||||||
|
first_work_time = convert_datetime(first_work_time).new_offset(self.time_offset)
|
||||||
|
end
|
||||||
|
return first_work_time
|
||||||
|
end
|
||||||
def check_and_store
|
def check_and_store
|
||||||
unless self.new_record?
|
unless self.new_record?
|
||||||
time_now = DateTime.now.utc
|
time_now = DateTime.now.utc
|
||||||
|
@ -321,7 +330,7 @@ class RulingTimerTemp
|
||||||
end
|
end
|
||||||
ruling_timer_history.send("#{field_name}=",self.send(field_name))
|
ruling_timer_history.send("#{field_name}=",self.send(field_name))
|
||||||
end
|
end
|
||||||
ruling_timer_history.date = self.get_last_work_time.new_offset(self.time_offset).strftime("%Y/%m/%d %w")
|
ruling_timer_history.date = self.get_first_work_time.new_offset(self.time_offset).strftime("%Y/%m/%d %w")
|
||||||
ruling_timer_history.user = self.user
|
ruling_timer_history.user = self.user
|
||||||
ruling_timer_history.save
|
ruling_timer_history.save
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue