Consider timezone in cfp.open?

This commit is contained in:
nolleto 2021-11-04 15:36:37 -03:00 committed by Henne Vogelsang
parent 6e276b2787
commit 6bf34a84eb
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6

View file

@ -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
##