Skip to content
Snippets Groups Projects
Unverified Commit 8086576f authored by Felix Eckhofer's avatar Felix Eckhofer :man_dancing:
Browse files

Use more congress-compatible start of day

parent 713e384d
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,13 @@ class ConferencesController < ApplicationController ...@@ -9,7 +9,13 @@ class ConferencesController < ApplicationController
if params[:date] if params[:date]
date = Time.parse(params[:date]) date = Time.parse(params[:date])
logger.debug(date) logger.debug(date)
@sessions = @sessions.where(starts_at: date.beginning_of_day..date.end_of_day) start_of_day = lambda { |date|
date.change(
hour: Rails.configuration.start_of_day.hour,
min: Rails.configuration.start_of_day.min
)
}
@sessions = @sessions.where(starts_at: start_of_day.call(date)..start_of_day.call(date.advance(days: 1)))
end end
@users = User.all @users = User.all
end end
......
...@@ -23,5 +23,9 @@ module ReScheduled ...@@ -23,5 +23,9 @@ module ReScheduled
# #
# config.time_zone = "Central Time (US & Canada)" # config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras") # config.eager_load_paths << Rails.root.join("extras")
# Talks that start before the time of day of this object are considered to
# belong to the previous day
config.start_of_day = Time.new(1970, 1, 1, 7, 0, 0)
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment