uNmAnNeR / imaskjs

vanilla javascript input mask

Home Page:https://imask.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Date mask types: make parse/format required if custom pattern is used

uNmAnNeR opened this issue · comments

          I faced the similar issue and found this thread. If I got it right, the problem is that if I provide any custom `pattern` for date mask I also need to specify `format` and `parse` functions corresponding to it otherwise results will be unexpected like mentioned above.

@uNmAnNeR Maybe, docs should be a little bit more specific on this. Wouldn't it better to add typings constraints disallowing to pass non-default pattern without format and parse functions and throw an error if it's been passed?

Originally posted by @ezze in #100 (comment)