mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
improve template readability
This commit is contained in:
parent
7d5d935a65
commit
3f2f35283c
3 changed files with 15 additions and 11 deletions
|
|
@ -172,6 +172,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 unless selected_schedule.present?
|
||||
parsed_date = DateTime.parse("#{date} 00:00").utc
|
||||
range = parsed_date..(parsed_date + 1.day)
|
||||
selected_schedule.event_schedules.any? { |es| range.cover?(es.start_time) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue