File tree Expand file tree Collapse file tree
assets/js/components/pdf-export Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import type {
4747 WidgetPDFConfig ,
4848} from '@/js/googlesitekit/widgets/types' ;
4949import useViewOnly from '@/js/hooks/useViewOnly' ;
50+ import { getPreviousDate } from '@/js/util' ;
5051import { getPDFFilename , triggerDownload } from './pdf-utils' ;
5152import DashboardReport from './shared-react-pdf-components/DashboardReport' ;
5253import type { PDFReportArea , PDFReportWidget } from './types' ;
@@ -214,8 +215,13 @@ const PDFExportOrchestrator: FC< PDFExportOrchestratorProps > = ( {
214215 const dates = useSelect (
215216 ( select : Select ) =>
216217 select ( CORE_USER ) . getDateRangeDates ( {
217- offsetDays : 1 ,
218218 compare : true ,
219+ // The PDF reporting period excludes the current day, so end the
220+ // range on the day before the reference date.
221+ referenceDate : getPreviousDate (
222+ select ( CORE_USER ) . getReferenceDate ( ) ,
223+ 1
224+ ) ,
219225 } ) as PDFReportDates ,
220226 [ ]
221227 ) ;
You can’t perform that action at this time.
0 commit comments