Code Monkey home page Code Monkey logo

react-input-date-mask's Introduction

react-input-date-mask

At the moment, the project is not supported, I will only be glad if someone makes a fork and finalizes it

Input date masking component for React. React-input-date-mask requires React 16.8.0 or later.

Table of Contents

Install

npm install react-input-date-mask --save

Usage

import React from 'react';
import ReactInputDateMask from 'react-input-date-mask';

function DateInput(props) {
    return <ReactInputDateMask  mask='dd/mm/yyyy' showMaskOnFocus={true}  className={props.className} value={props.value} onChange={props.onChange} showMaskOnHover={true} />;
  
}

Properties

Name Type Default Description
mask {String} 'dd.mm.yyyy' Mask format
showMaskOnFocus {Boolean} false If this option - true, the mask will only be displayed when an event occurs onFocus
showMaskOnHover {Boolean} false If this option - true, when you mouse over the input, the mask appears, when you mouse leave the input, the mask disappears
className {String}
onChange {Function}
disabled {Boolean} false
readOnly {Boolean} false

mask

Mask format. Can be a string. There are two options. The first option by default: 'dd.mm.yyyy'. The second options: 'mm.dd.yyyy'. As a separator, you can use / or .

 <ReactInputDateMask mask='mm.dd.yyyy' or <ReactInputDateMask mask='dd.mm.yyyy'
 <ReactInputDateMask mask='mm/dd/yyyy' or <ReactInputDateMask mask='dd/mm/yyyy'

showMaskOnFocus

If this option - false, the mask will always be displayed. If this option - true, the mask will only be displayed when an event occurs onFocus

showMaskOnHover

This option is available when the option "showMaskOnFocus" - true. If this option - true, when you mouse over the input, the mask appears, when you mouse leave the input, the mask disappears

properties

You can also pass the following properties: className, disabled, readOnly, onChange

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.