[fix]Fix program#any_event_for_this_date?

This commit is contained in:
Jimmy 2021-04-13 11:41:13 +08:00 committed by CactusPuppy
parent 4f68051b9e
commit 83ecd98997
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82

View file

@ -195,6 +195,7 @@ class Program < ApplicationRecord
# * +True+ -> If there is any event for the given date
# * +False+ -> If there is not any event for the given date
def any_event_for_this_date?(date)
return false if date.nil? || date.empty?
return false unless selected_schedule.present?
parsed_date = DateTime.parse("#{date} 00:00").utc