Skip to content

Commit 06381f1

Browse files
author
Roman Lytvynenko
committed
MAGETWO-99832: Order grid saved view with Purchased date show Invalid date after switching views
1 parent bfcb002 commit 06381f1

File tree

1 file changed

+15
-3
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/element

1 file changed

+15
-3
lines changed

app/code/Magento/Ui/view/base/web/js/form/element/date.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@ define([
7676
*
7777
* @type {String}
7878
*/
79-
shiftedValue: ''
79+
shiftedValue: '',
80+
81+
/**
82+
* Stored Date format initially received from server
83+
* for offline date formatting
84+
*
85+
* @private
86+
* @type {String}
87+
*/
88+
storedDateFormat: ''
8089
},
8190

8291
/**
@@ -125,9 +134,12 @@ define([
125134
shiftedValue = moment(value, dateFormat);
126135
}
127136

128-
if (!shiftedValue.isValid()) {
129-
shiftedValue = moment(value, this.pickerDateTimeFormat);
137+
if (this.storedDateFormat) {
138+
shiftedValue = moment(value, this.storedDateFormat);
139+
} else {
140+
this.storedDateFormat = dateFormat;
130141
}
142+
131143
shiftedValue = shiftedValue.format(this.pickerDateTimeFormat);
132144
} else {
133145
shiftedValue = '';

0 commit comments

Comments
 (0)