Skip to content

Commit c694777

Browse files
committed
Fix date formats without divider
Formats like `yyyy` are splitted in `formatParts = [ 'y', 'y', 'y', 'y' ]` and not like `formatParts = [ 'yyyy' ]`.
1 parent a3b142a commit c694777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

form-validator/jquery.form-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@
908908
parseDate : function(val, dateFormat) {
909909
var divider = dateFormat.replace(/[a-zA-Z]/gi, '').substring(0,1),
910910
regexp = '^',
911-
formatParts = dateFormat.split(divider),
911+
formatParts = dateFormat.split(divider || null),
912912
matches, day, month, year;
913913

914914
$.each(formatParts, function(i, part) {

0 commit comments

Comments
 (0)