RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.4k stars 2.16k forks source link

Multi dates #2697

Open cungobu opened 1 year ago

cungobu commented 1 year ago

Hi, Is there a way to insert more than one dates in inputmask? I saw we have a solution for multi-email mask. Could we have the same one for dates? I need this mask for flatpickr with multiple selected dates. https://flatpickr.js.org/examples/#selecting-multiple-dates

Thanks

cungobu commented 12 months ago

Actually, sometimes we have needs for multiple elements which may be not only dates but also numbers. Today, I have to create a mask allowing to input 2 hours, another mask allowing to input 2 minutes. In fact, I tried to do it with the below definition

Inputmask.extendAliases({
    'multi-numbers': {
        mask: '*{1,20}',
        definitions: {
            '*': {
                validator: '[0-9,]'
            }
        }
    }
});

However, it allows multiple integers only while you know a hour must be in a range [0, 23] and a minute must be in a range [0, 59]. It is easy to implement a single hour mask or a single minute mask so what I need is the options as "quantifier", "separator" that I see you supported for email. Could you kindly bring those options to common so that we can apply to many purposes?

Thanks, Cuong