We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 269eae6 + 86518bd commit b3ad364Copy full SHA for b3ad364
app/code/Magento/Customer/view/frontend/web/js/validation.js
@@ -8,6 +8,20 @@ define([
8
], function ($, moment, utils) {
9
'use strict';
10
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
25
$.validator.addMethod(
26
'validate-dob',
27
function (value, element, params) {
0 commit comments