date-mask

1.0.3 • Public • Published

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 />

Package Sidebar

Install

npm i date-mask

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

7.33 kB

Total Files

6

Last publish

Collaborators

  • jaouadballat