Merge pull request #66 from CactusPuppy/177736599-program#any_event_for_this_date

Fix program#any_event_for_this_date
This commit is contained in:
kingdish 2021-04-13 12:05:14 +08:00 committed by GitHub
commit e340758e6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 == ''
return false unless selected_schedule.present?
parsed_date = DateTime.parse("#{date} 00:00").utc