0
I am currently formatting a date field with the following mask:
$("input[type='date']").mask('dD/mM/yYYY', {
                                        translation: {
                                                        d: {pattern: /[0-3]/},
                                                        D: {pattern: /[0-9]/},
                                                        m: {pattern: /[0-1]/},
                                                        M: {pattern: /[0-2]/},
                                                        y: {pattern: /[1-2]/},
                                                        Y: {pattern: /[0-9]/},
                                                        Y: {pattern: /[0-9]/},
                                                        Y: {pattern: /[0-9]/}
                                                      }
                                                });
But I would like to at least can prevent that on the first occurrence, if the day starts with digit 3 allow the next digit to be only 0 or 1, which would result on days 30 and 31.
What do you mean in the first instance? First time the field gains focus..?
– victor
You cannot change your mask to (d/mM/yyyy) where d = [0-2][0-9]|3[0-1]?
– victor