function (chrs, buffer, pos, strict, opts) {
                        var frontValue = buffer.join('').substr(0, 3);
                        if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator;
                        var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                        if (!strict && !isValid) {
                            if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
                                isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                if (isValid) {
                                    buffer[pos - 1] = "0";
                                    return { "pos": pos, "c": chrs.charAt(0) };
                                }
                            }
                        }
                        return isValid;
                    }
function (chrs, buffer, pos, strict, opts) {
                        var frontValue = buffer.join('').substr(0, 3);
                        if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator;
                        var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                        if (!strict && !isValid) {
                            if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
                                isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                if (isValid) {
                                    buffer[pos - 1] = "0";
                                    return { "pos": pos, "c": chrs.charAt(0) };
                                }
                            }
                        }
                        return isValid;
                    }
function ( chrs , buffer , pos , strict , opts ) { var frontValue = buffer . join ( '' ) . substr ( 0 , 3 ) ; if ( frontValue . indexOf ( opts . placeholder [ 0 ] ) != - 1 ) frontValue = "01" + opts . separator ; var isValid = opts . regex . val2 ( opts . separator ) . test ( frontValue + chrs ) ; if ( ! strict && ! isValid ) { if ( chrs . charAt ( 1 ) == opts . separator || "-./" . indexOf ( chrs . charAt ( 1 ) ) != - 1 ) { isValid = opts . regex . val2 ( opts . separator ) . test ( frontValue + "0" + chrs . charAt ( 0 ) ) ; if ( isValid ) { buffer [ pos - 1 ] = "0" ; return { "pos" : pos , "c" : chrs . charAt ( 0 ) } ; } } } return isValid ; }
val2 ~ day or month
val2 ~ day or month
check if the character is valid