Browse Source

Fix flaky tests - date handling in generate_different_date_within_collection_year

pull/3067/head
Manny Dinssa 1 week ago
parent
commit
766ab097a8
  1. 4
      app/helpers/collection_time_helper.rb

4
app/helpers/collection_time_helper.rb

@ -55,8 +55,8 @@ module CollectionTimeHelper
end
def generate_different_date_within_collection_year(date, start_date_override: nil, end_date_override: nil)
start_date = [start_date_override, collection_start_date(date).to_date].compact.max.to_date
end_date = [end_date_override, collection_end_date(date).to_date].compact.min.to_date
start_date = [start_date_override&.to_date, collection_start_date(date).to_date].compact.max.to_date
end_date = [end_date_override&.to_date, collection_end_date(date).to_date].compact.min.to_date
return nil if start_date >= end_date

Loading…
Cancel
Save