1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

refacto project service, do the same but it is clear that service is receiving a date and not a time

This commit is contained in:
Nicolas Florentin 2023-11-23 11:28:28 +01:00
parent f18454bf97
commit 7c4a6781d6

View File

@ -32,8 +32,8 @@ class ProjectService
end
end
created_from = Time.zone.parse(query_params['from_date']).beginning_of_day if query_params['from_date'].present?
created_to = Time.zone.parse(query_params['to_date']).end_of_day if query_params['to_date'].present?
created_from = Date.parse(query_params['from_date']).in_time_zone.beginning_of_day if query_params['from_date'].present?
created_to = Date.parse(query_params['to_date']).in_time_zone.end_of_day if query_params['to_date'].present?
if created_from || created_to
records = records.where(created_at: created_from..created_to)
end