From 0c9f1270c506413bb03572beb928a808e0409a80 Mon Sep 17 00:00:00 2001 From: Kevin L <40267301+a8ck3n@users.noreply.github.com> Date: Tue, 14 Jan 2025 18:45:54 +0800 Subject: [PATCH] Override the query period for custom ranges --- client/my-sites/stats/summary/index.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/my-sites/stats/summary/index.jsx b/client/my-sites/stats/summary/index.jsx index 4eaed80c055d6..4d2db939aa056 100644 --- a/client/my-sites/stats/summary/index.jsx +++ b/client/my-sites/stats/summary/index.jsx @@ -89,11 +89,14 @@ class StatsSummary extends Component { }; // Update query with date range if it provided. + // Note that we force the period to 'day' for custom date ranges as other periods do not make sense + // in the context of our updated Traffic page and do not match the results as shown there. const dateRange = this.props.dateRange; if ( dateRange ) { query.start_date = dateRange.startDate.format( 'YYYY-MM-DD' ); query.date = dateRange.endDate.format( 'YYYY-MM-DD' ); query.summarize = 1; + query.period = 'day'; // Override for custom date ranges. } const moduleQuery = merge( {}, statsQueryOptions, query );