Skip to content

Commit e5f46b0

Browse files
author
Robert He
committed
MAGETWO-68976: [Magento Cloud] Incorrect date format with Arabic language locale
- filter out any additional locale information besides MmDdYy and the separators (‘/‘,’.’,’-‘)
1 parent c3587c2 commit e5f46b0

File tree

1 file changed

+1
-4
lines changed
  • app/code/Magento/Catalog/Block/Product/View/Options/Type

1 file changed

+1
-4
lines changed

app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ public function getCalendarDateHtml()
8383

8484
$dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT);
8585
/** Escape RTL characters which are present in some locales and corrupt formatting */
86-
$patterns = [];
87-
$patterns[0] = '/[^[:print:]]/';
88-
$patterns[1] = '/[^MmDdYy\/\.\-]/';
89-
$escapedDateFormat = preg_replace($patterns, '', $dateFormat);
86+
$escapedDateFormat = preg_replace('/[^MmDdYy\/\.\-]/', '', $dateFormat);
9087
$calendar = $this->getLayout()->createBlock(
9188
\Magento\Framework\View\Element\Html\Date::class
9289
)->setId(

0 commit comments

Comments
 (0)