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

schedule-react-component

v2.37.0-0

Published

a schedule component for react

Downloads

1

Readme

Downloads

Schedule-react-compoent

<Schedule onAdd={onAdd} onCancel={onCancel} />

Installing

$ npm i schedule-react-component

Exports

import { Schedule, Ireservation } from 'schedule-react-component';

Props

Common props you may want to specify include:

  • workingHours - the working hours example : [{ hour: '9-10', isReserved: false, val: 9 }, { hour: '10-11', isReserved: false, val: 10 }, { hour: '11-12', isReserved: false, val: 11 }, { hour: '13-14', isReserved: false, val: 13 }, { hour: '14-15', isReserved: false, val: 14 }, { hour: '15-16', isReserved: false, val: 15 }, { hour: '16-17', isReserved: false, val: 16 }]
  • daysOff - the days you don't want to reserve example : ['Sun','Sat']
  • reservations - reservations data
  • OnAdd - on add reservation
  • calendarClass - calendar css class
  • dayClass - day css class
  • hourClass - hour css class
  • dialogClass - dialog css class
  • dialogTitle - dialog title
  • input - choose the dialog input , select or other component ...
  • cancelDialogTitle - cancel dialog title
  • onCancel - on cancecl reservation function
  • cancelDialogClass - cancel dialog css class

Schedule Usage

import { Ireservation, Schedule } from 'schedule-react-component'

//your data
const reservs: Array<Ireservation> = [
  { date: "2023-01-06T00:00:00.000Z", day: 6, hour: 14, id: 1, month: 1, year: 2023 },
  { date: "2023-01-06T00:00:00.000Z", day: 6, hour: 15, id: 1, month: 1, year: 2023 },
  { date: "2023-01-07T00:00:00.000Z", day: 7, hour: 16, id: 1, month: 1, year: 2023 },
  { date: "2023-02-06T00:00:00.000Z", day: 6, hour: 15, id: 1, month: 2, year: 2023 },
  { date: "2023-03-06T00:00:00.000Z", day: 6, hour: 15, id: 1, month: 3, year: 2023 },
  { date: "2023-04-06T00:00:00.000Z", day: 6, hour: 15, id: 1, month: 4, year: 2023 },
  { date: "2023-05-06T00:00:00.000Z", day: 31, hour: 15, id: 1, month: 1, year: 2023 },
]

const Component = () => {
  const onAdd = (hour: number, day: number, month: number, year: number) => {
    Post('api/addReservation',{hour,day,month,year})
  }
  const onCancel = (hour: number, day: number, month: number, year: number) => {
    Delete('api/deleteReservation',{hour,day,month,year})
  }
  return (
    <div>
      <Schedule OnAdd={onAdd} onCancel={onCancel} reservations={reservs} />
    </div>
  )
}

export default Component

License

MIT