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

rjs-booking-calendar

v1.2.5

Published

A customizable booking calendar component for React.

Downloads

35

Readme

rjs-booking-calendar

A customizable booking calendar component for react

License

MIT License

Features

  • Installation
  • How to Use
  • Example
  • Props

Installation

  npm i rjs-booking-calendar --save

How to Use

import on the _app.js or layout.js

    import "rjs-booking-calendar/dist/index.css"

import the library on the page/component file

    import BookingCalendar from 'rjs-booking-calendar';

Example

Example image

Props

<BookingCalendar
  mode='week'
  slotData={slotList}
  onSlotSelect={handleSlotSelect}
  onMonthChange={handleMonthChange}
  disablePastDates={true}
  timeSlots={customTimeSlots}
  onClearAll={clearSlots}
  maxSelections={2}
/>

| Parameter | Description | Default | | ---------------- | ------------------------------------------------------------------- | -------------------- | | mode | Specifies the display mode, either 'week' or 'month'. | 'month' | | slotData | A list containing slot data. | {} | | onSlotSelect | Callback function triggered upon slot selection. | | | onMonthChange | Callback function triggered when the month changes. | | | disablePastDates | Disables the selection of past dates. | false | | timeSlots | A complete list of time slots. | Refer to timeSlots | | onClearAll | Callback function triggered when the "Clear All" button is clicked. | | | maxSelections | Maximum number of slots that can be selected. | Infinity | | startYear | The starting year (default is 10 years before the current year). | current year - 10 | | endYear | The ending year (default is 10 years after the current year). | current year + 10 | | monthNames | An array of month names. | | | weekdayNames | An array of weekday names. | | | showClearButton | Determines whether to display the clear button. | true | | startWeekOn | The day the week starts on (e.g., 'sunday'). | 'sunday' |

slotData = {
  '2024-9-25': [
    { time: '9:00 AM - 12:00 PM', status: 'booked' },
    { time: '5:00 PM - 9:00 PM', status: 'available' },
  ],
  '2024-9-26': [
    { time: '9:00 AM - 12:00 PM', status: 'reserved' },
    { time: '5:00 PM - 9:00 PM', status: 'available' },
  ],
};
const timeSlots = [
  '9:00 AM - 10:00 AM',
  '10:00 AM - 11:00 AM',
  '11:00 AM - 12:00 PM',
  '1:00 PM - 2:00 PM',
  '2:00 PM - 3:00 PM',
  '3:00 PM - 4:00 PM',
];