remove unnessary timezone convertion
This commit is contained in:
@@ -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!" }
|
||||
|
||||
Reference in New Issue
Block a user