1.0.12 • Published 4 years ago

react-input-date v1.0.12

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

react-input-date

NPM JavaScript Style Guide

A simple input to enter dates. Inspired on Typeform input and trying to follow the flexibility and the philosophy of React-select.

Install

npm install --save react-input-date

or

yarn add react-input-date

Usage

import React, { Component } from 'react'

import DateInput from 'react-input-date'

class Example extends Component {
  state = {
    date: '12-02-2020'
  }
  handleChange = (newDate) => {
    this.setState({ date: newDate })
  }

  render() {
    const { date } = this.state
    return (
      <DateInput
        date={date}
        format='DDMMYYYY'
        separator='-'
        onChange={handleChange}
      />
    )
  }
}

With React Hooks

import React, { useState } from 'react'

import DateInput from 'react-input-date'

const Example = () => {
  const [date, setDate] = useState('12-02-2020')

  return (
    <DateInput date={date} format='DDMMYYYY' separator='-' onChange={setDate} />
  )
}

Props

Common props yoy want to specify

  • date
  • format
  • separator
  • onChange

License

MIT © ramirobg94

Made with create-react-library

1.0.12

4 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

9 years ago