Skip to content

Commit 8c36f6f

Browse files
committed
ACP2E-4239: Date Filter not working according to store timezone on Credit Memos grid
1 parent a6693e4 commit 8c36f6f

File tree

2 files changed

+6
-4
lines changed
  • app/code/Magento/Ui

2 files changed

+6
-4
lines changed

app/code/Magento/Ui/Component/Form/Element/DataType/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function convertDateWithTimezone(
130130
bool $useStoreTimeZone = true
131131
): ?\DateTime {
132132
if (!$useStoreTimeZone) {
133-
$this->convertDate($date, $hour, $minute, $second, $setUtcTimeZone);
133+
return $this->convertDate($date, $hour, $minute, $second, $setUtcTimeZone);
134134
}
135135

136136
try {

app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Ui\Component\Filters\FilterModifier;
1717
use Magento\Ui\Component\Filters\Type\Date;
1818
use Magento\Ui\Component\Form\Element\DataType\Date as FormDate;
19+
use PHPUnit\Framework\MockObject\Exception;
1920
use PHPUnit\Framework\MockObject\MockObject;
2021
use PHPUnit\Framework\TestCase;
2122

@@ -210,9 +211,10 @@ public static function getPrepareDataProvider(): array
210211
* @param bool $showsTime
211212
* @param array $filterData
212213
* @param array $expectedCondition
213-
* @param MockObject $uiComponent
214+
* @param FormDate $uiComponent
214215
*
215216
* @return void
217+
* @throws Exception
216218
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
217219
*/
218220
private function processFilters(
@@ -244,8 +246,8 @@ private function processFilters(
244246
$uiComponent->method('convertDateWithTimezone')
245247
->willReturnMap(
246248
[
247-
[$filterData[$name]['from'], 0, 0, 0, true, $from],
248-
[$filterData[$name]['to'], 23, 59, 59, true, $to],
249+
[$filterData[$name]['from'], 0, 0, 0, true, true, $from],
250+
[$filterData[$name]['to'], 23, 59, 59, true, true, $to],
249251
]
250252
);
251253
}

0 commit comments

Comments
 (0)