event_calendar时区 [英] event_calendar time zone

查看:133
本文介绍了event_calendar时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能会错过一些东西,但如何event_calendar rails宝石确定时区?

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

在本地它尊重我的时区,但不在服务器上。我在heroku上运行它,所以它使用UTC来确定它的日期等。在Application.rb我设置

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 = 太平洋时间(美国和加拿大)

所有我发现的是这个较旧的讨论,不是决定性的。有没有改变?
https://github.com/elevation/event_calendar/issues/4

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

如何设置event_calendar gem的时区?

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

推荐答案

由于我没有找到更好的办法,我分配此项目,并将 Date.today 更改为时间。 zone.today 其中,appropiate。它一直在我的情况下工作。

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.

这篇关于event_calendar时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆