change dynamic checkin checkout
This commit is contained in:
@@ -179,5 +179,24 @@ class DiningFacility < ApplicationRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_time(time, booking = nil, type)
|
||||
status = true
|
||||
today = Time.now.utc
|
||||
check_time = Time.parse(time.strip).utc
|
||||
if type.downcase == "checkin"
|
||||
if check_time < today
|
||||
status = false
|
||||
end
|
||||
else
|
||||
if !booking.nil?
|
||||
checkin_at = booking.checkin_at.utc
|
||||
if check_time <= checkin_at
|
||||
status = false
|
||||
end
|
||||
end
|
||||
end
|
||||
return status
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user