-
Notifications
You must be signed in to change notification settings - Fork 47
Fix wrong value for lteq_datetime predicate #63
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
Fix wrong value for lteq_datetime predicate #63
Conversation
I only don't like the situation with timezones(client and server). Current situation: The browser sends selected time, and this time will be passed to SQL query as is. The user should know what timezone database-server uses, usually it is UTC. This is common misunderstanding situation. And I don't know how to handle it. Or it is not the responsibility of a this plugin? |
@workgena searching should be performed in the same timezone by default, not sure why not :) |
79c3b2f
to
548d64d
Compare
After some research I'm intent to merge current solution. It fixes the problem with config.add_predicate 'lteq_datetime',
arel_predicate: 'lt',
formatter: ->(v) { v + 1.day } The problem with timezone is complicated and is out of scope #61 , so it would be better to solve it in another PR. |
NOTICE:With this change we introduce new predicate <!-- old -->
<input id="q_created_at_gteq_datetime">
<!-- new -->
<input id="q_created_at_gteq_datetime_picker"> If somebody relies on this in Capybara tests, then such tests should be updated. |
[refs #61]