Skip to content

Commit 86518bd

Browse files
committed
MC-36024: Invalid Character Customer Account Create DOB
1 parent 4930963 commit 86518bd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app/code/Magento/Customer/view/frontend/web/js/validation.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ define([
88
], function ($, moment, utils) {
99
'use strict';
1010

11+
$.validator.addMethod(
12+
'validate-date',
13+
function (value, element, params) {
14+
var dateFormat = utils.convertToMomentFormat(params.dateFormat);
15+
16+
if (value === '') {
17+
return true;
18+
}
19+
20+
return moment(value, dateFormat, true).isValid();
21+
},
22+
$.mage.__('Invalid date')
23+
);
24+
1125
$.validator.addMethod(
1226
'validate-dob',
1327
function (value, element, params) {

0 commit comments

Comments
 (0)