-
Notifications
You must be signed in to change notification settings - Fork 47
"To" being set to "From" after submit. #65
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
Comments
In addition, So it's |
And finally, it has to be converted to a format which includes the time. |
Hello @schwern Thanks 🙏 for detailed 🔬 explanation of an issue. I'll take a look at this issue this/next weak. PS: Since you use DateTime, I would like to mention about timezone. The plugin does not know about difference of user(Web) and database time-zones. So you might check(logs/development.log) if the SQL query is what you actually expect. |
We encountered a problem where the date time range filter would show up with both fields having the placeholder "From". After submission the the lteq field would be set to the gteq field.
Here's the filter.
start
is adatetime
column.Showing the From/From.

Different values filled in.

After submission, To is set to From, but the original inputs were understood.

Upon investigation we noticed the IDs are
q_field_gteq
andq_field_lteq
for a Date rather thanq_field_gteq_datetimepicker
andq_field_lteq_datetimepicker
for a DateTime.I believe this is because ActiveAdmin::Inputs::Filters::DateTimeRangeInput inherits ActiveAdmin::Inputs::Filters::DateRangeInput#input_html_options which casts the value to a Date. This was added a few years ago.
This results in
DateTimeRangeInput#gt_input_name
andDateTimeRangeInput#lt_input_name
both using the name from their superclass DateRangeInput.The following monkey patch fixes the issue for us.
Here's our relevant Gemfile.lock.
The text was updated successfully, but these errors were encountered: