Skip to content

Commit 3833cbd

Browse files
ENGCOM-5413: Default filter for reports set to past month #23607
- Merge Pull Request #23607 from rogyar/magento2:default-report-filter-adjustment - Merged commits: 1. 9aa4744
2 parents c20732c + 9aa4744 commit 3833cbd

File tree

1 file changed

+2
-3
lines changed
  • app/code/Magento/Reports/Block/Adminhtml

1 file changed

+2
-3
lines changed

app/code/Magento/Reports/Block/Adminhtml/Grid.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ protected function _prepareCollection()
135135
$data = $this->parameters->toArray();
136136

137137
if (!isset($data['report_from'])) {
138-
// getting all reports from 2001 year
139-
$date = (new \DateTime())->setTimestamp(mktime(0, 0, 0, 1, 1, 2001));
138+
// Get records for the past month
139+
$date = new \DateTime('-1 month');
140140
$data['report_from'] = $this->_localeDate->formatDateTime(
141141
$date,
142142
\IntlDateFormatter::SHORT,
@@ -145,7 +145,6 @@ protected function _prepareCollection()
145145
}
146146

147147
if (!isset($data['report_to'])) {
148-
// getting all reports from 2001 year
149148
$date = new \DateTime();
150149
$data['report_to'] = $this->_localeDate->formatDateTime(
151150
$date,

0 commit comments

Comments
 (0)