1.1.2 • Published 4 years ago

react-input-datepicker v1.1.2

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

NPM npm bundle size GitHub contributors npm NPM

react-input-datepicker

A simple and reusable input datepicker component for React (Demo)

Input Datepicker

Install

npm install react-input-datepicker

Usage

import React, { useState, useCallback } from 'react';
import InputDatepicker from 'react-input-datepicker';

export const App = () => {
  const [value, setValue] = useState<Date | null>();

  const onDateChange = useCallback((date: Date) => {
    setValue(date);
  }, []);

  return (
    <InputDatepicker
      value={value}
      onDateChange={onDateChange}
      minDate={new Date(1900, 0, 1)}
      maxDate={new Date()}
    />
  );
};

Available Props

PropTypeDefaultOptions
valueDate--
onDateChangefunc--
minDateDate--
maxDateDate--
maxDateMessagestring'Date must be less than {maxDate + 1}'-
minDateMessagestring'Date must be greater than {minDate - 1}'-
invalidMessagestring'Not a valid date'-
showLabelsbooleantruetrue, false
showErrorsbooleantruetrue, false
showPlaceholdersbooleantruetrue, false
formatstring'month/day/year''day/month/year', 'day/year/month', 'month/day/year', 'month/year/day', 'year/month/day', 'year/day/month'
labelsObjectEnglish labels{ year: 'Year'; month: 'Month'; day: 'Day'; }

License

MIT © JMcAmmond

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

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