check min

This commit is contained in:
phyusin
2018-11-27 14:02:21 +06:30
parent 0b13ab7e0b
commit c0a449b444

View File

@@ -182,15 +182,15 @@ class DiningFacility < ApplicationRecord
def check_time(time, booking = nil, type)
status = true
today = Time.now.utc
check_time = Time.parse(time.strip).utc
today = Time.now.utc.strftime("%Y-%m-%d %H:%M")
check_time = Time.parse(time.strip).utc.strftime("%Y-%m-%d %H:%M")
if type.downcase == "checkin"
if check_time < today
status = false
end
else
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
status = false
end