1.0.5 • Published 5 years ago

react-text-datepicker v1.0.5

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

react-text-datepicker

Travis npm package Coveralls

Sometimes you don't want a calendar datepicker for your forms. Everybody knows his/her own birthday or other important dates that they can enter using old-fashion keyboard. This package helps you with this.

react-text-datepicker example

Installation

Install it from npm and include it in your React build process (using Webpack, Browserify, etc).

npm install --save react-text-datepicker

or:

yarn add react-text-datepicker

Usage

import React from "react";
import TextDatepicker from "react-text-datepicker";

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      myDate: new Date()
    };
    this.onChange = this.onChange.bind(this);
  }

  onChange(newValue) {
    this.setState({
      myDate: newValue
    });
  }

  render() {
    return (
      <TextDatepicker value={this.state.myDate} onChange={this.onChange} />
    );
  }
}

Props

Common props you may want to specify include:

propDescriptionDefault Value
dayHintchange the text displayed as placeholder for day inputDD
hintsspecify if you want to display placeholder for each inputtrue
monthHintchange the text displayed as placeholder for month inputMM
onChangesubscribe to change eventsnull
separatorchange the text displayed between parts of date/
valuecontrol the current valuenull
yearHintchange the text displayed as placeholder for year inputYYYY

License

MIT

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago