Skip to content

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 :)

@hennevogel hennevogel force-pushed the bugfix/CFP-conference-timezone branch from 57cf3ed to 8e68e67 Compare August 14, 2025 15:55
@hennevogel hennevogel force-pushed the bugfix/CFP-conference-timezone branch from 8e68e67 to 8be47fa Compare August 14, 2025 16:34
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