Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Move method to base controller (#12962)

brozekc6f264c98547
diff --git a/admin/app/controllers/spree/admin/base_controller.rb b/admin/app/controllers/spree/admin/base_controller.rb
index a019e9019f..f58c73c4e5 100644
--- a/admin/app/controllers/spree/admin/base_controller.rb
+++ b/admin/app/controllers/spree/admin/base_controller.rb
@@ -137,6 +137,12 @@ module Spree
'spree/admin'
end
+
+ def parse_date_param(date_string)
+ return if date_string.blank?
+
+ date_string.to_date&.in_time_zone(current_timezone)
+ end
end
end
end
diff --git a/admin/app/controllers/spree/admin/reports_controller.rb b/admin/app/controllers/spree/admin/reports_controller.rb
index 5982bcdce8..46dce01fbd 100644
--- a/admin/app/controllers/spree/admin/reports_controller.rb
+++ b/admin/app/controllers/spree/admin/reports_controller.rb
@@ -63,12 +63,6 @@ module Spree
attributes[:date_to] = parse_date_param(attributes[:date_to])&.end_of_day if attributes[:date_to].present?
attributes
end
-
- def parse_date_param(date_string)
- return if date_string.blank?
-
- date_string.to_date&.in_time_zone(current_timezone)
- end
end
end
end