From c0a449b444e3f66edb072ae2c7ade9950a5ff3c7 Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 27 Nov 2018 14:02:21 +0630 Subject: [PATCH] check min --- app/models/dining_facility.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/dining_facility.rb b/app/models/dining_facility.rb index e2a0b9a3..165fbe3a 100755 --- a/app/models/dining_facility.rb +++ b/app/models/dining_facility.rb @@ -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