remove unnessary timezone convertion

This commit is contained in:
Thein Lin Kyaw
2022-04-19 19:40:53 +06:30
parent 3c7fd0aff4
commit 3c5416a154
154 changed files with 321 additions and 321 deletions

View File

@@ -29,9 +29,9 @@ class Api::CheckInProcessController < Api::ApiController
check_out_time = nil
extra_minutes = nil
alert_time_min = 0
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_in_time = booking.checkin_at.strftime("%Y-%m-%d %H:%M")
if booking.checkout_at
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_out_time = booking.checkout_at.strftime("%Y-%m-%d %H:%M")
if booking.reserved_at
extra_minutes = (booking.checkout_at - booking.reserved_at) / 1.minutes
end
@@ -146,7 +146,7 @@ class Api::CheckInProcessController < Api::ApiController
booking.checkout_at = checkout_at
booking.save!
render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") }
render :json => { :status => true, :checkout_at => booking.checkout_at.strftime("%Y-%m-%d %H:%M") }
elsif !params[:booking_id].nil? && params[:time].nil?
error_message = "time is required!"
render :json => { :status => false, :error_message => error_message }
@@ -170,7 +170,7 @@ class Api::CheckInProcessController < Api::ApiController
booking.reserved_at = checkout_time
booking.reserved_by = current_login_employee.name
if booking.save!
render :json => { :status => true, :checkin_at => booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M:%S"), :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M:%S"), :message => "Checkout success." }
render :json => { :status => true, :checkin_at => booking.checkin_at.strftime("%Y-%m-%d %H:%M:%S"), :checkout_at => booking.checkout_at.strftime("%Y-%m-%d %H:%M:%S"), :message => "Checkout success." }
end
else
render :json => { :status => false, :error_message => "Checkout time not available!" }