diff --git a/app/models/award_year.rb b/app/models/award_year.rb index 98c1a974b4..3b8ebf02bc 100644 --- a/app/models/award_year.rb +++ b/app/models/award_year.rb @@ -314,8 +314,8 @@ def start_trading_between(from = 0, to = 1, **opts) end_date = Date.new(AwardYear.current.year - 1 - from, month, day) if opts[:minmax] == true - return (start_date..end_date).minmax.map { |d| d.strftime("%d/%m/%Y") } if opts[:format] == true - (start_date..end_date).minmax + return [start_date, end_date].minmax.map { |d| d.strftime("%d/%m/%Y") } if opts[:format] == true + [start_date, end_date] else start_date..end_date end @@ -333,8 +333,8 @@ def fy_date_range_threshold(**opts) to = to.change(year: year) if opts[:minmax] == true - return (from..to).minmax.map { |d| d.strftime("%d/%m/%Y") } if opts[:format] == true - (from..to).minmax + return [from, to].minmax.map { |d| d.strftime("%d/%m/%Y") } if opts[:format] == true + [from, to] else from..to end