File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,7 @@ public function getHtmlExtraParams()
303
303
public function getDateFormat ()
304
304
{
305
305
$ dateFormat = $ this ->setTwoDayPlaces ($ this ->_localeDate ->getDateFormatWithLongYear ());
306
+ $ dateFormat = $ this ->setTwoMonthPlaces ($ dateFormat );
306
307
/** Escape RTL characters which are present in some locales and corrupt formatting */
307
308
$ escapedDateFormat = preg_replace ('/[^MmDdYy\/\.\-]/ ' , '' , $ dateFormat );
308
309
@@ -440,4 +441,19 @@ private function setTwoDayPlaces(string $format): string
440
441
$ format
441
442
);
442
443
}
444
+
445
+ /**
446
+ * Set 2 places for month value in format string
447
+ *
448
+ * @param string $format
449
+ * @return string
450
+ */
451
+ private function setTwoMonthPlaces (string $ format ): string
452
+ {
453
+ return preg_replace (
454
+ '/(?<!M)M(?!M)/ ' ,
455
+ 'MM ' ,
456
+ $ format
457
+ );
458
+ }
443
459
}
Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ define([
11
11
$ . validator . addMethod (
12
12
'validate-date' ,
13
13
function ( value , element , params ) {
14
- if ( params . dateFormat === 'M/dd/y' ) {
15
- params . dateFormat = 'MM/dd/y' ;
16
- }
17
14
var dateFormat = utils . normalizeDate ( params . dateFormat ) ;
15
+
18
16
if ( value === '' ) {
19
17
return true ;
20
18
}
You can’t perform that action at this time.
0 commit comments