File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
app/code/Magento/Ui/view/base/web/js/form/element
dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,9 @@ define([
166
166
*/
167
167
prepareDateTimeFormats : function ( ) {
168
168
this . pickerDateTimeFormat = this . options . dateFormat ;
169
- this . momentFormat = ( this . options . dateFormat ) ? this . convertToMomentFormat ( this . options . dateFormat ) : this . momentFormat ;
169
+ this . momentFormat = this . options . dateFormat ?
170
+ this . convertToMomentFormat ( this . options . dateFormat ) : this . momentFormat ;
171
+
170
172
if ( this . options . showsTime ) {
171
173
this . pickerDateTimeFormat += ' ' + this . options . timeFormat ;
172
174
}
@@ -184,15 +186,18 @@ define([
184
186
} ,
185
187
186
188
/**
187
- * @param format PHP Format
188
- * @returns {String } Moment compatible format
189
+ * Converts PHP IntlFormatter format to moment format.
190
+ *
191
+ * @param {String } format - PHP format
192
+ * @returns {String } - moment compatible formatting
189
193
*/
190
- convertToMomentFormat : function ( format ) {
194
+ convertToMomentFormat : function ( format ) {
191
195
var newFormat ;
192
196
193
197
newFormat = format . replace ( / y y | y / gi, 'YYYY' ) ; // replace the year
194
198
newFormat = newFormat . replace ( / d d | d / g, 'DD' ) ; // replace the date
195
199
newFormat = newFormat . replace ( / m m | m / g, 'MM' ) ; //replace the month
200
+
196
201
return newFormat ;
197
202
}
198
203
} ) ;
Original file line number Diff line number Diff line change @@ -923,7 +923,6 @@ vendor/magento/module-ui/view/base/web/js/form/components/html.js
923
923
vendor/magento/module-ui/view/base/web/js/form/components/tab_group.js
924
924
vendor/magento/module-ui/view/base/web/js/form/components/tab.js
925
925
vendor/magento/module-ui/view/base/web/js/form/element/abstract.js
926
- vendor/magento/module-ui/view/base/web/js/form/element/date.js
927
926
vendor/magento/module-ui/view/base/web/js/form/element/helpers/options.js
928
927
vendor/magento/module-ui/view/base/web/js/form/element/multiselect.js
929
928
vendor/magento/module-ui/view/base/web/js/form/element/post-code.js
You can’t perform that action at this time.
0 commit comments