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-core

v0.0.14

Published

A core library for creating calendars with check-in and check-out functionality in React.

Downloads

20

Readme

react-check-in-out-calendar-core

The react-check-in-out-calendar-core library provides the core functionality of the react-check-in-out-calendar component. It is a lightweight library that enables you to have the powerful date manipulation capabilities of the original component without the UI elements, giving you complete freedom to design and style your own calendar component.

Installation

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

npm install react-check-in-out-calendar-core

Or with yarn:

yarn add react-check-in-out-calendar-core

Props

| Prop Name | Type | Description | Default | | ------------------ | ------------------------------------------------- | --------------------------------------------------------------------------------- | ----------------------- | | 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 | | 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-core';

function App() {
  const handleChange = (in, out) => {
    console.log(in, out );
  };
  return (
     <Calendar
        startDay={0}
        numMonths={2}
        language="ko"
        maximumMonths={12}
        defaultCheckIn="2023-06-01"
        defaultCheckOut="2023-06-15"
        onCheckInOutChange={handleChange}
      />
  );
}

CSS ClassNames

Here are the CSS class names that are used in the original react-check-in-out-calendar library, which you can use for styling your custom calendar component:

  • calendar-container: The main container for the Calendar component.
  • month-navigation-container: The main container for the MonthNavigation component.
  • button-wrapper: The wrapper for the buttons in the MonthNavigation component.
  • button: The buttons in the MonthNavigation component.
  • monthview-container: The main container for the MonthView component.
  • weekday-header-container: The main container for the WeekdayHeader component.
  • day-cell: The cells in the MonthView component.
  • day-cell-in-range: The cells that are within the check-in and check-out range.
  • day-cell-selected: The cells that are either the check-in or check-out date.
  • other-day : The cells representing dates that fall outside of the current month, i.e., dates from the previous or the next month that are displayed in the current month's calendar view.
  • before-today : The cells representing dates that occur before the current date. These dates are generally not selectable in the context of a booking or reservation system.

UI Library

react-check-in-out-calendar

  • The UI library is currently still under development. At present, the core library has not yet been incorporated. Therefore, what we have is the original calendar library which combines both the previous logic and UI. Updates integrating the core library will be coming soon.

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.

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.