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

Invalid timezone error #70

Open
navjeetc opened this issue May 15, 2023 · 2 comments
Open

Invalid timezone error #70

navjeetc opened this issue May 15, 2023 · 2 comments

Comments

@navjeetc
Copy link

navjeetc commented May 15, 2023

I get a "invalid time zone" error on line Time.use_zone(current_user.time_zone, &block) in application controller as the code calendar.time_zone.split('/').last.gsub('_', ' ') in sessions controller strips of America from America/New_York. If I remove .split('/').last.gsub('_', ' ') all is good. Is that an appropriate fix and should I create a PR or not?

@softr8
Copy link
Member

softr8 commented May 16, 2023

Yes please, according to the documentation, google returns the timezone Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich" And Time.find_zone! already expects this format, maybe we need to fallback to app time zone? this line needs to be adjusted as well, and lastly, we might need to create a presenter to show in the UI a formatted timezone name

@piscespieces
Copy link

Same issue. I tried with @navjeetc approach by deleting .split('/').last.gsub('_', ' ') but kept getting this error.

Then I completely deleted the set_time_zone from ApplicationController and I still get this error!

Invalid Timezone: Chicago
[app/controllers/application_controller.rb:56:in `set_time_zone'](http://localhost:3000/conversations#)

I have run already docker compose down && docker compose up

I'm just craking up this codebase for first time, not sure what am I doing wrong here

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

No branches or pull requests

3 participants