Files
nairobi/app/controllers/concerns/dashboard/expects_date_range.rb
Juan Salvador Pérez García 3590657777 Enhancements on supports controller
Supports controller now fill the holes in the results: When there are no
supports collected for one interval it takes the accumulated value from the
previous one.

Data starts in the publication date.
2018-09-14 10:49:29 +02:00

16 lines
379 B
Ruby

module Dashboard::ExpectsDateRange
extend ActiveSupport::Concern
include Dashboard::HasProposal
def start_date(fallback_date = proposal.created_at.to_date)
return Date.parse(params[:start_date]) unless params[:start_date].blank?
fallback_date
end
def end_date
return Date.parse(params[:end_date]) unless params[:end_date].blank?
Date.today
end
end