Sort Shift recount and scrutiny dates

This commit is contained in:
Bertocq
2017-10-02 13:08:55 +02:00
parent 5c513d8051
commit 9d7be9b57c

View File

@@ -5,7 +5,7 @@ module ShiftsHelper
end end
def shift_recount_scrutiny_dates(polls) def shift_recount_scrutiny_dates(polls)
date_options(polls.map(&:ends_at).map(&:to_date).inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq) date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq)
end end
def date_options(dates) def date_options(dates)