Skip to content

Commit 3a31197

Browse files
committed
MC-17269: Date format grid is not based on the locale defined in the back-office
1 parent db905b8 commit 3a31197

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/Listing/Columns/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function prepare()
105105
);
106106

107107
$config['storeLocale'] = $this->locale;
108-
$config['dateData'] = [
108+
$config['calendarConfig'] = [
109109
'months' => $months,
110110
'monthsShort' => $monthsShort,
111111
];

app/code/Magento/Ui/view/base/web/js/grid/columns/date.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ define([
1515

1616
return Column.extend({
1717
defaults: {
18-
dateFormat: 'MMM d, YYYY h:mm:ss A'
18+
dateFormat: 'MMM d, YYYY h:mm:ss A',
19+
calendarConfig: []
1920
},
20-
dateData: [],
2121

2222
/**
2323
* Overrides base method to normalize date format.
@@ -38,7 +38,9 @@ define([
3838
* @returns {String} Formatted date.
3939
*/
4040
getLabel: function (value, format) {
41-
moment.locale(this.storeLocale, {...this.dateData});
41+
if (this.storeLocale !== undefined) {
42+
moment.locale(this.storeLocale, {...this.calendarConfig});
43+
}
4244
var date = moment(this._super());
4345

4446
date = date.isValid() && value[this.index] ?

0 commit comments

Comments
 (0)