Description
date-mask
is an react package allowing to format user input date by ensuring a predefined format.
Installation
npm install date-mask --save
How to use it
// With ES6let Input from 'date-mask' // With ES5 var Input = <Input />
and we can passe all properties that normal input have throught props:
<Input = ="12/06/1989" />
if we need to customize separator we have choice between those 3 separators ('/', '-', '.')
<Input ='-' />
we have also the possibility to define date format where year is left yyyy/dd/mm
, just by adding yearFirst
property
<Input ='-' />