Quick correction, commercial week is a Date method...

This commit is contained in:
echarp 2018-01-27 18:09:58 +01:00
parent b2fc347303
commit 43a957e2b7
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class DigestsController < ApplicationController
private
def set_week
@week = Time.commercial params[:period][:year].to_i,
@week = Date.commercial params[:period][:year].to_i,
params[:period][:week].to_i
end

View File

@ -59,7 +59,7 @@ class Event < ApplicationRecord
start_date.to_date.end_of_month.end_of_week.end_of_day
end)
scope :period, (lambda do |year, week|
start_date = Time.commercial(year.to_i, week.to_i)
start_date = Date.commercial(year.to_i, week.to_i)
where '? <= end_time and start_time <= ?',
start_date, start_date.end_of_week.end_of_day
end)