From d7f75ba40db3034bf16736fab8dc40a0638bab9b Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Thu, 14 Nov 2024 11:19:44 +0100 Subject: [PATCH] Cleanup --- app/views/datagrid/_range_filter.html.erb | 3 ++- lib/datagrid/utils.rb | 2 -- version-2/views.diff | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/datagrid/_range_filter.html.erb b/app/views/datagrid/_range_filter.html.erb index ffbb0f8..21d1f0e 100644 --- a/app/views/datagrid/_range_filter.html.erb +++ b/app/views/datagrid/_range_filter.html.erb @@ -1,4 +1,5 @@ <%= form.datagrid_filter_input(filter, class: 'datagrid-range-from', **from_options) %> <%= I18n.t('datagrid.filters.range.separator') %> <%# Generating id only for "from" input to make sure -%> -<%# there is no duplicate id in DOM and click on label focuses the first input -%> <%= form.datagrid_filter_input(filter, class: 'datagrid-range-to', **to_options, id: nil) %> +<%# there is no duplicate id in DOM and click on label focuses the first input -%> +<%= form.datagrid_filter_input(filter, class: 'datagrid-range-to', **to_options, id: nil) %> diff --git a/lib/datagrid/utils.rb b/lib/datagrid/utils.rb index f0c5d26..c7ea68d 100644 --- a/lib/datagrid/utils.rb +++ b/lib/datagrid/utils.rb @@ -121,8 +121,6 @@ def parse_datetime(value) def format_date_as_timestamp(value) if !value value - # elsif value.is_a?(Array) - # value.first&.beginning_of_day..value.last&.end_of_day elsif value.is_a?(Range) value.begin&.beginning_of_day..value.end&.end_of_day else diff --git a/version-2/views.diff b/version-2/views.diff index f971d0e..61c42fa 100644 --- a/version-2/views.diff +++ b/version-2/views.diff @@ -78,16 +78,17 @@ index e939128..b355528 100644 <% end %> diff --git a/app/views/datagrid/_range_filter.html.erb b/app/views/datagrid/_range_filter.html.erb -index 7a8a123..3b8ca85 100644 +index 7a8a123..ffbb0f8 100644 --- a/app/views/datagrid/_range_filter.html.erb +++ b/app/views/datagrid/_range_filter.html.erb -@@ -1,3 +1,3 @@ +@@ -1,3 +1,4 @@ -<%= form.datagrid_filter_input(filter, **from_options) %> -<%= I18n.t('datagrid.filters.range.separator') %> -<%= form.datagrid_filter_input(filter, **to_options) %> +<%= form.datagrid_filter_input(filter, class: 'datagrid-range-from', **from_options) %> +<%= I18n.t('datagrid.filters.range.separator') %> -+<%= form.datagrid_filter_input(filter, class: 'datagrid-range-to', **to_options) %> ++<%# Generating id only for "from" input to make sure -%> ++<%# there is no duplicate id in DOM and click on label focuses the first input -%> <%= form.datagrid_filter_input(filter, class: 'datagrid-range-to', **to_options, id: nil) %> diff --git a/app/views/datagrid/_row.html.erb b/app/views/datagrid/_row.html.erb index f54d21c..340aea6 100644 --- a/app/views/datagrid/_row.html.erb