Skip to content

Commit 85c2deb

Browse files
authored
Fix: Datepicker problem when using non en-US locale.
Current code convert date format "yyyy/MM/dd" to "YYYYYYYY/MM/DD".
1 parent cabb18b commit 85c2deb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/web/mage/utils/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ define([
251251
convertToMomentFormat: function (format) {
252252
var newFormat;
253253

254-
newFormat = format.replace(/yy|y/gi, 'YYYY'); // replace the year
254+
newFormat = format.replace(/yyyy|yy|y/, 'YYYY'); // replace the year
255255
newFormat = newFormat.replace(/dd|d/g, 'DD'); // replace the date
256256

257257
return newFormat;

0 commit comments

Comments
 (0)