0

Hi I might be missing something but how does event_calendar the rails gem determines time zone?

Locally it respects my timezone but not on server. I am running it on heroku so it used UTC to determine the day it is in etc. On Application.rb I set

config.time_zone = "Pacific Time (US & Canada)".

All I found was this older discussion that is not conclusive. Has this changed? https://github.com/elevation/event_calendar/issues/4

How can I set the timezone for event_calendar gem? Thank you in advance for your help.

Yuri
  • 1,261
  • 1
  • 11
  • 23
  • I dont know about the `event_calendar` gem but there is something called `offset` in Ruby using which you can determine the amount of time you want to add or subtract from UTC to get your local time. – uday Feb 03 '12 at 04:45
  • Hi Dave, Thank you for your response. I am not sure however, how to set that offset (or time zone) to the calendar itself. – Yuri Feb 03 '12 at 18:21
  • I would suggest you to see this list of calendar [`gems`](https://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=calendar). Also see the [`Time`](http://ruby-doc.org/core-1.9.3/Time.html) Ruby class – uday Feb 03 '12 at 20:30
  • I picked event calendar from that list of gems. As I mentioned, I am having issue with the Gem itself. NOT with ruby or Time.zone in any way. It is setting that to the event_calendar gem default that is giving trouble. I have this question on github for this gem as well but no answers have come in yet. Thanks for your help. – Yuri Feb 04 '12 at 02:03

1 Answers1

1

Since I haven't found a better way I forked this project and changed Date.today to Time.zone.today where appropiate. It has been working for my scenario.

Yuri
  • 1,261
  • 1
  • 11
  • 23