Very buggy behavior when date format have 'd' or 'm'
Author: LehakosCreated Feb 22, 2018Updated Sep 19, 2026
LabelsDatesMainEnhancement / Feature
Hello. My mask options are
inputFormat: dateFormat.toLowerCase(),
alias: 'datetime',
autoUnmask: true,
onUnMask(masked) {
const date = moment(masked, dateFormat.toUpperCase());
if (date.isValid()) {
return date.format('DD.MM.YYYY');
}
return masked;
},
rightAlign: false,
showMaskOnHover: false,
showMaskOnFocus: false,
positionCaretOnClick: 'none',
insertMode: true,dateFormat is equal to 'm.d.yyyy'
First bug
- Type 11.20.2000 in input
- Delete 11 and type 2 Result: 2..20.2000 Expected: 2.20.2000 After that i even can to get so result 2.222.2222
Second bug
- Type 2.4.2000 Problem: cannot insert 1 or 2 before day. I want to change 4 to 24, but i can't Problem: when inserted first number 2, placeholder transform to 2._______ Expected: 2..__
Third bug
- Type 2.12.2000
- Delete first 2
- Type 11 Result: 1112.2000 Expected: 11.12.2000
Source: RobinHerbots/Inputmask