mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
22 lines
557 B
JavaScript
22 lines
557 B
JavaScript
|
(function( factory ) {
|
||
|
if ( typeof define === "function" && define.amd ) {
|
||
|
define( ["jquery", "../jquery.validate"], factory );
|
||
|
} else {
|
||
|
factory( jQuery );
|
||
|
}
|
||
|
}(function( $ ) {
|
||
|
|
||
|
/*
|
||
|
* Localized default methods for the jQuery validation plugin.
|
||
|
* Locale: ES_CL
|
||
|
*/
|
||
|
$.extend($.validator.methods, {
|
||
|
date: function(value, element) {
|
||
|
return this.optional(element) || /^\d\d?\-\d\d?\-\d\d\d?\d?$/.test(value);
|
||
|
},
|
||
|
number: function(value, element) {
|
||
|
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}));
|