check time

This commit is contained in:
phyusin
2018-04-09 16:23:16 +06:30
parent b5016edb0d
commit 4bc56a31b8
4 changed files with 11 additions and 10 deletions

View File

@@ -49,7 +49,7 @@ class Api::CheckInProcessController < Api::ApiController
arr_time = checkout_time[0].split("-")
start_time = Time.parse(arr_time[0].strip).utc.getlocal.strftime("%H:%M%p")
end_time = Time.parse(arr_time[1].strip).utc.getlocal.strftime("%H:%M%p")
if start_time <= checkout_at.strftime("%H:%M%p") && checkout_at.strftime("%H:%M%p") <= end_time
if start_time <= today.strftime("%H:%M%p") && today.strftime("%H:%M%p") <= end_time
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
end
end