JSPM

pick-datetime-react

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q27036F
  • License MIT

Datetime picker for React

Package Exports

  • pick-datetime-react
  • pick-datetime-react/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pick-datetime-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.