From 9fa71e198e59ca4969532a8aa8cf2aff993ae193 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 1 Feb 2018 15:59:39 -0500 Subject: [PATCH] FIX: admin reports charts should use same time of day as dashboard numbers --- app/controllers/admin/reports_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb index 6490c96d73e..dec448528d4 100644 --- a/app/controllers/admin/reports_controller.rb +++ b/app/controllers/admin/reports_controller.rb @@ -7,8 +7,8 @@ class Admin::ReportsController < Admin::AdminController raise Discourse::NotFound unless report_type =~ /^[a-z0-9\_]+$/ - start_date = params[:start_date].present? ? Time.parse(params[:start_date]) : 30.days.ago - end_date = params[:end_date].present? ? Time.parse(params[:end_date]) : start_date + 30.days + start_date = (params[:start_date].present? ? Time.zone.parse(params[:start_date]) : 30.days.ago).beginning_of_day + end_date = (params[:end_date].present? ? Time.zone.parse(params[:end_date]) : start_date + 30.days).end_of_day if params.has_key?(:category_id) && params[:category_id].to_i > 0 category_id = params[:category_id].to_i