uNmAnNeR / imaskjs

vanilla javascript input mask
https://imask.js.org
MIT License
4.96k stars 258 forks source link

Date only works with "." #1062

Closed td-cdleon closed 3 months ago

td-cdleon commented 3 months ago

Describe the bug When using any other divider than dot "." the year only allows three digits for example -> 15/10/198

To Reproduce

    <IMaskInput
      mask={Date}
      onAccept={onChange}
      pattern={'d/m/Y'}
      placeholder={placeholder}
      required={required}
    />

*Expected behavior** it should show 15/10/1988 instead of 15/10/198

Environment:

uNmAnNeR commented 3 months ago

check the guide https://imask.js.org/guide.html#masked-date

egorovsa commented 16 hours ago

@uNmAnNeR Hi . There is a bug If I change pattern to "d{/}m{/}Y" or any patterns. I can't type the very last number. It does not allow me to write full date like 17/04/2020 it stopes on 17/04/202 What can we do ?

        <IMaskInput
          mask={Date}
          pattern="d{-}`m{-}`Y"
        />