From e9d7b9e2f5918671c4d91ea63311852b94063718 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 1 Feb 2018 15:31:48 +0630 Subject: [PATCH] change utc to utc.getlocal --- app/controllers/api/check_in_process_controller.rb | 6 +++--- app/controllers/origami/check_in_process_controller.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/check_in_process_controller.rb b/app/controllers/api/check_in_process_controller.rb index 883fb1ea..45d3ed1a 100644 --- a/app/controllers/api/check_in_process_controller.rb +++ b/app/controllers/api/check_in_process_controller.rb @@ -41,12 +41,12 @@ class Api::CheckInProcessController < Api::ApiController lookup_checkout_time = Lookup.collection_of("checkout_time") if !lookup_checkout_time.empty? - checkout_at = Time.now.utc + checkout_at = Time.now.utc.getlocal 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 diff --git a/app/controllers/origami/check_in_process_controller.rb b/app/controllers/origami/check_in_process_controller.rb index 14d5c90c..8f28c365 100644 --- a/app/controllers/origami/check_in_process_controller.rb +++ b/app/controllers/origami/check_in_process_controller.rb @@ -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