[fix] Fix style; Fix start_hour and end_hour in test
This commit is contained in:
parent
85fe894876
commit
39d4960b69
3 changed files with 3 additions and 2 deletions
|
|
@ -56,6 +56,7 @@ class EventSchedule < ApplicationRecord
|
|||
#
|
||||
def happening_now?(threshold = 30.minutes)
|
||||
return false if end_time < Time.now
|
||||
|
||||
event_time_range = start_time..end_time
|
||||
now_range = (Time.now - threshold)..(Time.now + threshold)
|
||||
event_time_range.overlaps?(now_range)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
%h3
|
||||
This page was loaded at
|
||||
= inyourtz(Time.now) do
|
||||
#{Time.now.strftime('%a %b %d at %I:%M %P (%z)').to_s}
|
||||
= Time.now.strftime('%a %b %d at %I:%M %P (%z)')
|
||||
|
||||
.row
|
||||
/ TODO: Clean this up, merge with all events page.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ describe SchedulesController do
|
|||
|
||||
describe 'GET #happening_now' do
|
||||
before do
|
||||
@conference2 = create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now)
|
||||
@conference2 = create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now, start_hour: 0, end_hour: 24)
|
||||
@program = @conference2.program
|
||||
@selected_schedule = create(:schedule, program: @program)
|
||||
@program.update_attributes!(selected_schedule: @selected_schedule)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue