File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed
app/code/Magento/Ui/view/base/web/js/form/element Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,7 @@ define([
76
76
*
77
77
* @type {String }
78
78
*/
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 : ''
79
+ shiftedValue : ''
89
80
} ,
90
81
91
82
/**
@@ -130,18 +121,16 @@ define([
130
121
if ( this . options . showsTime ) {
131
122
shiftedValue = moment . tz ( value , 'UTC' ) . tz ( this . storeTimeZone ) ;
132
123
} else {
133
- if ( this . storedDateFormat ) {
134
- dateFormat = this . storedDateFormat ;
135
- } else {
136
- dateFormat = this . shiftedValue ( ) ? this . outputDateFormat : this . inputDateFormat ;
137
- this . storedDateFormat = dateFormat ;
138
- }
124
+ dateFormat = this . shiftedValue ( ) ? this . outputDateFormat : this . inputDateFormat ;
139
125
shiftedValue = moment ( value , dateFormat ) ;
140
126
}
141
127
128
+ if ( ! shiftedValue . isValid ( ) ) {
129
+ shiftedValue = moment ( value , this . inputDateFormat ) ;
130
+ }
142
131
shiftedValue = shiftedValue . format ( this . pickerDateTimeFormat ) ;
143
132
} else {
144
- shiftedValue = '' ;
133
+ shiftedValue = this . shiftedValue ( ) ;
145
134
}
146
135
147
136
if ( shiftedValue !== this . shiftedValue ( ) ) {
You can’t perform that action at this time.
0 commit comments