docbrown/app/controllers/admin/overview_controller.rb
Monica Mateiu 99401449d4
Display analytics up to yesterday instead of today (#17064)
Stop displaying admin analytics for current day, as the data is incomplete. Instead, show analytics for any given period up to yesterday
2022-04-04 15:17:32 -04:00

11 lines
343 B
Ruby

module Admin
class OverviewController < Admin::ApplicationController
layout "admin"
def index
@length = (params[:period] || 7).to_i
@labels = (1..@length).map { |n| n.days.ago.strftime("%b %d") }.reverse
@analytics = Admin::ChartsData.new(@length).call
@data_counts = Admin::DataCounts.call
end
end
end