0.0.10 • Published 2 years ago

react-date-picker-mc v0.0.10

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

React Date Picker

A simple and easy to use date picker build with React and dayjs

Static Badge

Features

  • Display a calendar
  • Select date
  • Change month and year quickly with selector

Installation

To install, you can use npm or yarn:

$ npm install react-date-picker-mc
$ yarn add react-date-picker-mc

⚠️ These component needs to receive a dayjs date object
$ npm install daysjs
$ yarn add daysjs

Usage

The component needs two props:

PropsTypesRequiredDefaultDescription
isOpenBoolBoolean that indicates if the calendat tootip should be open or not
setIsOpenfunctionchange the state of isOpen
dateObjectA dayjs date object
setDatefunctionchange the state of date
import { Datepicker } from 'react-date-picker-mc'
import "react-date-picker-mc/dist/style.css"

import dayjs from "dayjs";
import weekday from 'dayjs/plugin/weekday'
dayjs.extend(weekday)

function App() {
    const [date, setDate] = useState(dayjs())
    const [calendarIsOpen, setCalendarIsOpen] = useState(false)
  return (
    <div className="App">
        <Datepicker isOpen={calendarIsOpen} setIsOpen={setCalendarIsOpen} selectedDate={date} setSelectedDate={setDate} />
    </div>
  )
}

export default App

🔗 Links

portfolio linkedin

github

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago