npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-check-in-out-calendar

v0.1.2

Published

React Check-In/Out Calendar is a customizable calendar component for React applications, built with TypeScript. It provides a user-friendly interface to select check-in and check-out dates for various booking or reservation systems.

Downloads

172

Readme

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 Name | Type | Description | Default | | ------------------ | ------------------------------------------------- | --------------------------------------------------------------------------------- | ----------------------- | | mainColor | string | The primary color of the calendar | '#ff375c' | | subMainColor | string | The primary color of the calendar | '#FEC0CA' | | startDay | 0 | 1 | 2 | 3 | 4 | 5 | 6 | The starting day of the week | 0 | | numMonths | 1 | 2 | 3 | 4 | The number of months to be shown in the calendar | 2 | | language | "ko" | "en" | The language for the calendar | 'en' | | maximumMonths | number | The maximum number of months that the calendar can display. (i.e 12, 24, 36, ...) | 12 | | defaultCheckIn | string | Dayjs | The check-in date in "YYYY-MM-DD" format. | 7 days from current day | | defaultCheckOut | string | Dayjs | The check-out date in "YYYY-MM-DD" format. | 8 days from current day | | isRectangular | boolean | Determines if the date cells should be displayed as rectangles instead of circles | false | | onCheckInOutChange | (checkInDate?: Date, checkOutDate?: Date) => void | Callback 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.