change utc to utc.getlocal

This commit is contained in:
phyusin
2018-02-01 15:31:48 +06:30
parent ee17ddac92
commit e9d7b9e2f5
2 changed files with 6 additions and 6 deletions

View File

@@ -2,12 +2,12 @@ class Origami::CheckInProcessController < BaseOrigamiController
def check_in_process
lookup_checkout_time = Lookup.collection_of("checkout_time")
checkout_at = Time.now.utc
checkout_at = Time.now.utc.getlocal
if !lookup_checkout_time.empty?
lookup_checkout_time.each do |checkout_time|
arr_time = checkout_time[0].split("-")
start_time = Time.parse(arr_time[0].strip).utc.strftime("%H:%M%p")
end_time = Time.parse(arr_time[1].strip).utc.strftime("%H:%M%p")
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 && checkout_at <= end_time
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
end