# schedule-react-component

> a schedule component for react

Latest version **2.37.0-0** (published 2023-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install schedule-react-component
pnpm add schedule-react-component
yarn add schedule-react-component
bun add schedule-react-component
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.37.0-0 |
| Published | 2023-01-06 |
| First published | 2023-01-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 4 |
| Unpacked size | 185.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | youssef1129 |
| Maintainers | youssef1129 |
| Keywords | react, react-component, typescript |

## Links

- npm: https://www.npmjs.com/package/schedule-react-component
- Repository: https://github.com/youssef1129/schedule-react-component
- Homepage: https://youssef1129.github.io/schedule-react-component-demo/
- Issues: https://github.com/youssef1129/schedule-react-component/issues
- npm.io page: https://npm.io/package/schedule-react-component

## Dependencies (4)

- [cssnano](https://npm.io/package/cssnano.md) ^5.1.14
- [react-icons](https://npm.io/package/react-icons.md) ^4.7.1
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^10.4.13
- [rollup-plugin-postcss](https://npm.io/package/rollup-plugin-postcss.md) ^4.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.37.0-0 (latest) — 2023-01-06
- 2.36.0 — 2023-01-02
- 2.35.0 — 2023-01-02
- 2.34.0 — 2023-01-02
- 2.33.0 — 2023-01-02
- 2.32.0 — 2023-01-02
- 2.31.0 — 2023-01-02
- 2.30.0 — 2023-01-02
- 2.29.0 — 2023-01-02
- 2.28.0 — 2023-01-02
- 2.27.0 — 2023-01-02
- 2.26.0 — 2023-01-02
- 2.25.0 — 2023-01-02
- 2.24.0 — 2023-01-02
- 2.22.0 — 2023-01-02
- … 15 more at https://npm.io/package/schedule-react-component/versions

## README

[![Downloads](https://img.shields.io/badge/npm-downloads-brightgreen)](https://www.npmjs.com/package/schedule-react-component)


# Schedule-react-compoent



<p align="center">
  <img src="https://i.imgur.com/6M4gRIt.gif">
</p>



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

- [Demo](https://youssef1129.github.io/schedule-react-component-demo/)

------

### Installing

```bash
$ npm i schedule-react-component
```

### Exports


```js
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

```js
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

---
_Source: https://npm.io/package/schedule-react-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
