From 6bf34a84ebbead6fa928d3d3b70eb34795ad767d Mon Sep 17 00:00:00 2001 From: nolleto Date: Thu, 4 Nov 2021 15:36:37 -0300 Subject: [PATCH] Consider timezone in `cfp.open?` --- app/models/cfp.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/cfp.rb b/app/models/cfp.rb index ccc04097..eb43f20c 100644 --- a/app/models/cfp.rb +++ b/app/models/cfp.rb @@ -75,7 +75,9 @@ class Cfp < ApplicationRecord # * +false+ -> If the CFP is not set or today isn't in the CFP period. # * +true+ -> If today is in the CFP period. def open? - (start_date..end_date).cover?(Date.current) + current_date = Time.now.in_time_zone(program.conference.timezone).to_date + + (start_date..end_date).cover?(current_date) end ##