date-mask
v1.0.3
Published
`date-mask` is an react package allowing to format user input date by ensuring a predefined format.
Downloads
4
Maintainers
Readme
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 ES6
let Input from 'date-mask'
// With ES5
var Input = require('date-mask')
<Input />
and we can passe all properties that normal input have throught props:
<Input onChange={handleInputChange} value="12/06/1989" />
if we need to customize separator we have choice between those 3 separators ('/', '-', '.')
<Input separator='-' />
we have also the possibility to define date format where year is left yyyy/dd/mm
, just by adding yearFirst
property
<Input separator='-' yearFirst />