Searchlogic 无法根据日期时间条件正确转换时间
Searchlogic 的作者说它被委托给 A::R 转换器,但至少在我们的例子中,这并没有涵盖通常的情况。当地时间被“解释”为 UTC,因此移动一小时 (CET)。
我怎样才能正确地做到这一点?
我添加了我们当前的解决方法作为答案,希望它对某人有所帮助!
The author of Searchlogic says that it is delegated to A::R converter, but at least in our case this didn't cover the usual cases. Local time was 'interpreted' as UTC and therefore was moved by one hour (CET).
How can I do that properly?
I add our current workaround as an answer, hopefully it helps somebody!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们已将以下方法添加到应用程序控制器:
然后在创建 searchlogic 对象之前,我们“预处理”参数哈希:
非常感谢任何更清晰、更好、更好的解决方案/想法:)!
我们的环境.rb:
We've added the following method to the application controller:
And then before creating the searchlogic object we 'preprocess' the params hash:
Any clearer better and nicer solutions/ideas are very appreciated :)!
our environment.rb: