pick-datetime-react
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

pick-datetime-react

A simple and reusable date-time picker component for React.

version MIT License 🚀 Publish

Installation

Install via NPM:

npm install pick-datetime-react --save

or by using Yarn:

yarn add pick-datetime-react

Examples

For datepicker:

<Datepicker
  label="Booking date"
  name="bookingDate"
  placeholder="Choose a date"
  // minDate={new Date()}
  // maxDate={new Date(2022, 1, 26)}
  // weekEnds={['Sun', 'Sat']}
  onChange={(date) => console.log(date)}
  // message={{ value: 'Please select a valid date' }}
/>

For timepicker:

const now = new Date();

<Timepicker
  label="Booking time"
  name="bookingTime"
  placeholder="Choose a time"
  // rightAlign
  // slotGap={20}
  // format="24"
  // startFrom={`${now.getHours()}:${now.getMinutes()}`}
  onChange={(time) => console.log(time)}
  // message={{ value: 'Please select a valid time' }}
/>;

License

Licensed under MIT license, see LICENSE for the full license.

Package Sidebar

Install

npm i pick-datetime-react

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

89.4 kB

Total Files

24

Last publish

Collaborators

  • sonjoydatta