Closed workgena closed 4 years ago
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?
@senid231 @Fivell perhaps you have better solution? Feel free to change/add/replace the PR.
@workgena searching should be performed in the same timezone by default, not sure why not :)
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.
With this change we introduce new predicate gteq_datetime_picker
. It means the HTML will be different from previous versions:
<!-- 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]