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

希望能够自定义 timezone #15

Open
huobazi opened this issue May 23, 2020 · 2 comments
Open

希望能够自定义 timezone #15

huobazi opened this issue May 23, 2020 · 2 comments

Comments

@huobazi
Copy link

huobazi commented May 23, 2020

我猜现在 ruby-china 的 exception-track 表格显示的时间列内显示的是 UTC 时间
ref :ruby-china/homeland@3873cf3

希望能单独配置能够设置 timezone , 优先于或者不依赖 /config/application.rb 里面配置的 time_zone

@huacnlee
Copy link
Member

你可以覆盖 exception-track 的 View 模版来实现。
稍后我支持一下,按 application 的语言显示

@huobazi
Copy link
Author

huobazi commented May 24, 2020

现在应该就是按照所 mout 的 rails 应用程序的 application.rb 中对于 timezone 的设置来 to_s 并 format 的

比如 config/application.rb 里设置了

 config.time_zone = "Beijing" 

页面 render 出来的就是 "xxx +8" 这样的, 如果未设置, 则是 "xxx UTC" 这样的

homeland 现在的代码并没有在 application.rb 内设置 timezone, 是在 controller 内做的,不过这个 controller 影响不到 exception-track 的 controller 所以出现了和其他地方不一致的日期显示

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

No branches or pull requests

2 participants