0.1.2 • Published 11 months ago

react-check-in-out-calendar v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-check-in-out-calendar

This package provides a simple and customizable calendar component for React applications. It uses the power of styled-components for styling, the flexibility of React context for state management, and the dayjs library for all the date manipulations.

Installation

Use the package manager npm to install react-check-in-out-calendar

npm install react-check-in-out-calendar

Or with yarn:

yarn add react-check-in-out-calendar

Props

Prop NameTypeDescriptionDefault
mainColorstringThe primary color of the calendar'#ff375c'
subMainColorstringThe primary color of the calendar'#FEC0CA'
startDay0 | 1 | 2 | 3 | 4 | 5 | 6The starting day of the week0
numMonths1 | 2 | 3 | 4The number of months to be shown in the calendar2
language"ko" | "en"The language for the calendar'en'
maximumMonthsnumberThe maximum number of months that the calendar can display. (i.e 12, 24, 36, ...)12
defaultCheckInstring | DayjsThe check-in date in "YYYY-MM-DD" format.7 days from current day
defaultCheckOutstring | DayjsThe check-out date in "YYYY-MM-DD" format.8 days from current day
isRectangularbooleanDetermines if the date cells should be displayed as rectangles instead of circlesfalse
onCheckInOutChange(checkInDate?: Date, checkOutDate?: Date) => voidCallback function when check-in or check-out date changes.

Usage

import { Calendar } from "react-check-in-out-calendar";

function App() {
  return (
    <Calendar
      mainColor="#ff6347"
      subMainColor="#ffa07a"
      startDay={0}
      numMonths={2}
      language="ko"
      maximumMonths={12}
      defaultCheckIn="2023-06-01"
      defaultCheckOut="2023-06-15"
      isRectangular={true}
      onCheckInOutChange={(checkInDate, checkOutDate) => {
        console.log("Check-in: ", checkInDate, " Check-out: ", checkOutDate);
      }}
    />
  );
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

The MIT License.

Planned Updates

Custom Styling: We are working on resetting the default styles of the calendar component to provide more flexibility for customization. Soon, users will be able to apply their own styling by providing custom class names and overriding the default styles.

Core Library and UI Library Separation: We are also planning to separate the core functionality of the calendar from the UI components. This will allow users to use their preferred UI libraries or build their own UI components while still leveraging the calendar's powerful date manipulation capabilities.

Stay tuned for these upcoming updates, and feel free to reach out with any questions or suggestions you may have.

Core Library

react-check-in-out-calendar-core

Contact

If you have any questions or suggestions, please feel free to contact me. I'm always open to improving this package and would love to hear any ideas or solve any issues you may have.

  • Email: sgsg9447@gmail.com
  • GitHub: sgsg9447
0.0.25

12 months ago

0.1.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.0.26

12 months ago

0.0.24

12 months ago

0.0.23

12 months ago

0.0.22

12 months ago

0.0.21

12 months ago

0.0.20

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago

0.0.0

12 months ago