Skip to content

Commit 331f351

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-362: Invalid date-time format in the admin order grid for French local
1 parent ad7baa3 commit 331f351

File tree

2 files changed

+5
-4
lines changed
  • app/code/Magento/Ui/Component/Listing/Columns
  • lib/web/mage/utils

2 files changed

+5
-4
lines changed

app/code/Magento/Ui/Component/Listing/Columns/Date.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ public function prepare()
114114
];
115115
if (!isset($config['dateFormat'])) {
116116
$config['dateFormat'] = $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM);
117-
if ($config['storeLocale'] == 'fr_CA' || $config['storeLocale'] == 'pt_BR') {
118-
$config['dateFormat'] = preg_replace("/([^']*)'([^']+)'([^']*)/", '$1[$2]$3', $config['dateFormat']);
119-
}
120117
}
121118
$this->setData('config', $config);
122119

lib/web/mage/utils/misc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ define([
9393
var result = mageFormat;
9494

9595
_.each(map, function (moment, mage) {
96-
result = result.replace(mage, moment);
96+
result = result.replace(
97+
new RegExp(`${mage}(?=([^']*'[^']*')*[^']*$)`),
98+
moment
99+
);
97100
});
101+
result = result.replace(/'(.*?)'/g, '[$1]');
98102

99103
return result;
100104
},

0 commit comments

Comments
 (0)