mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Added tests for program#any_event_for_this_date?
This commit is contained in:
parent
6a1d757f43
commit
6eb8c8d6ae
3 changed files with 51 additions and 3 deletions
|
|
@ -165,7 +165,7 @@ class Program < ApplicationRecord
|
|||
# * +False+ -> If there is not any event for the given date
|
||||
def any_event_for_this_date?(date)
|
||||
parsed_date = DateTime.parse("#{date} 00:00").utc
|
||||
EventSchedule.where(schedule: selected_schedule).where(start_time: parsed_date..(parsed_date + 1)).any?
|
||||
EventSchedule.where(schedule: selected_schedule).where(start_time: parsed_date..(parsed_date + 1.day)).any?
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue