File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
app/code/Magento/Ui/view/base/web/js/lib/validation Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,23 @@ define([
1101
1101
return moment . utc ( value , params . dateFormat ) . isSameOrBefore ( moment . utc ( ) ) ;
1102
1102
} ,
1103
1103
$ . mage . __ ( 'The Date of Birth should not be greater than today.' )
1104
+ ] ,
1105
+ /* detect chars that would require more than 3 bytes */
1106
+ 'validate-no-utf8mb4-characters' : [
1107
+ function ( value ) {
1108
+ var validator = this ,
1109
+ message = $ . mage . __ ( 'Please remove invalid characters: {0}.' ) ,
1110
+ matches = value . match ( / (?: [ \uD800 - \uDBFF ] [ \uDC00 - \uDFFF ] ) / g) ,
1111
+ result = matches === null ;
1112
+
1113
+ if ( ! result ) {
1114
+ validator . charErrorMessage = message . replace ( '{0}' , matches . join ( ) ) ;
1115
+ }
1116
+
1117
+ return result ;
1118
+ } , function ( ) {
1119
+ return this . charErrorMessage ;
1120
+ }
1104
1121
]
1105
1122
} , function ( data ) {
1106
1123
return {
You can’t perform that action at this time.
0 commit comments