check min
This commit is contained in:
@@ -182,15 +182,15 @@ class DiningFacility < ApplicationRecord
|
|||||||
|
|
||||||
def check_time(time, booking = nil, type)
|
def check_time(time, booking = nil, type)
|
||||||
status = true
|
status = true
|
||||||
today = Time.now.utc
|
today = Time.now.utc.strftime("%Y-%m-%d %H:%M")
|
||||||
check_time = Time.parse(time.strip).utc
|
check_time = Time.parse(time.strip).utc.strftime("%Y-%m-%d %H:%M")
|
||||||
if type.downcase == "checkin"
|
if type.downcase == "checkin"
|
||||||
if check_time < today
|
if check_time < today
|
||||||
status = false
|
status = false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if !booking.nil?
|
if !booking.nil?
|
||||||
checkin_at = booking.checkin_at.utc
|
checkin_at = booking.checkin_at.utc.strftime("%Y-%m-%d %H:%M")
|
||||||
if check_time <= checkin_at
|
if check_time <= checkin_at
|
||||||
status = false
|
status = false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user