I'm 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 at least like to prevent that in the first occurrence, if the day starts with digit 3 to allow the next digit to be only 0 or 1, that would result in days 30 and 31.