Skip to content

Commit 59ff70d

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock
1 parent 242aae9 commit 59ff70d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ public function formatDate(
822822
$showTime = false,
823823
$timezone = null
824824
) {
825-
$date = $date instanceof \DateTimeInterface ? $date : new \DateTime($date);
825+
$date = $date instanceof \DateTimeInterface ? $date : new \DateTime($date ?? 'now');
826826
return $this->_localeDate->formatDateTime(
827827
$date,
828828
$format,
@@ -845,7 +845,7 @@ public function formatTime(
845845
$format = \IntlDateFormatter::SHORT,
846846
$showDate = false
847847
) {
848-
$time = $time instanceof \DateTimeInterface ? $time : new \DateTime($time);
848+
$time = $time instanceof \DateTimeInterface ? $time : new \DateTime($time ?? 'now');
849849
return $this->_localeDate->formatDateTime(
850850
$time,
851851
$showDate ? $format : \IntlDateFormatter::NONE,

0 commit comments

Comments
 (0)