Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CFP conference timezone #2904

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nolleto
Copy link

@nolleto nolleto commented Nov 4, 2021

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the upstream master branch.
  • The tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works(if appropriate).
  • I have added necessary documentation (if appropriate).

Short description of what this resolves/which issues does this fix?:

Changes proposed in this pull request:

  • Now, the CFP will check the conference timezone to verify if it's open or not.

@nolleto nolleto changed the title Bugfix/cfp conference timezone Fix CFP conference timezone Nov 4, 2021
@hennevogel
Copy link
Member

Hey @nolleto thanks for this fix! 😃

@hennevogel
Copy link
Member

hennevogel commented Nov 10, 2021

Looks like you have to fix the model spec. I guess changing Time.zone isn't the best idea, maybe in_time_zone?

@hennevogel
Copy link
Member

let me know if you need help @nolleto

@nolleto
Copy link
Author

nolleto commented Nov 24, 2021

Sorry for the delay. I will update with in_time_zone today

@nolleto
Copy link
Author

nolleto commented Nov 24, 2021

Looks like you have to fix the model spec. I guess changing Time.zone isn't the best idea, maybe in_time_zone?

I think using in_time_zone will not work...

Time.zone = timezone_plus14
Timecop.freeze(Time.zone.now)
# VS
Timecop.freeze(Time.zone.now.in_time_zone(timezone_plus14))

Because I need the server and the cfp.program.conference.timezone be in a different timezone and executing Timecop.freeze(Time.zone.now.in_time_zone(timezone_plus14)) will not change the server time zone 🤔

So, I added an after to reset the server timezone to default

  describe '#open?' do
    let!(:server_timezone) { Time.zone }
    let(:timezone_plus14) { 'Pacific/Apia' }
    let(:timezone_plus14) { 'Pacific/Apia' }

    after do
      Time.zone = server_timezone
    end
  ...

But, if you have a better idea, just let me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants