0.4.54 • Published 6 years ago

legit-scheduler-multi-events v0.4.54

Weekly downloads
4
License
MIT
Repository
-
Last release
6 years ago

Codetree

Legit Scheduler

A pure React implementation of a drag and drop scheduler

Usage

Install it:

$ npm install --save legit-scheduler-multi-events

Import it:

import Scheduler from 'legit-scheduler-multi-events'

The scheduler component has three required props: events - An array of event objects resources - An array of resources width - The width of the scheduler container, in pixels. An integer.

The resources array is an array of objects:

{
  title: 'Resource 1', 
  default: 'Available' 
}

The events array is an array of objects:

{
  title: 'A great event',  // Required: The title of the event
  startDate: '2016-01-24', // Required: The start date, must be in the format of "YYYY-MM-DD"
  duration: 4,             // Required: The duration of the event in days
  resource: 'Resource 1',  // Required: The name of the resource the event belongs to. Must match the resource name from the resources prop
  id: '3829-fds89',        // Required: A unique identifier. This can be anything you want as long as it's unique
  disabled: false,         // Optional: Whether or not this event can be moved (it can still be resized). Defaults to false.
  styles: {}               // Optional: An object of styles to apply to the event object
}

The scheduler component also takes more optional props:

onEventChanged - A call back that is fired when the event is moved. It receives an object containing the new event props
onEventResized - A call back that is fired when the event is resized. It receives an object containing the new event props
onEventClicked - A call back that is fired when the event is clicked. It receives an object containing the event props
onCellClicked - A call back that is fired when an empty cell on the scheduler is clicked. It receives the date and resource name as props
onRangeChanged - A call back that is fired when the date range is changed. It receives a DateRange object with the new range.
from - Either a date string or a RangeDate object defining the start date for the range. to - Either a date string or a RangeDate object defining the end date for the range.

Development

$ npm install
$ npm run example

Visit: localhost:8080/example

0.4.54

6 years ago

0.4.53

6 years ago

0.4.52

6 years ago

0.4.51

6 years ago

0.4.50

6 years ago

0.4.49

6 years ago

0.4.48

6 years ago

0.4.47

6 years ago

0.4.46

6 years ago

0.4.45

6 years ago

0.4.44

6 years ago

0.4.43

6 years ago

0.4.42

6 years ago

0.4.41

6 years ago

0.4.40

6 years ago

0.4.39

6 years ago

0.4.38

6 years ago

0.4.37

6 years ago

0.4.36

6 years ago

0.4.35

6 years ago

0.4.34

6 years ago

0.4.33

6 years ago

0.4.32

6 years ago

0.4.31

6 years ago

0.4.30

6 years ago

0.4.29

6 years ago

0.4.28

6 years ago

0.4.27

6 years ago

0.4.26

6 years ago

0.4.25

6 years ago

0.4.23

6 years ago

0.4.22

6 years ago

0.4.21

6 years ago

0.4.20

6 years ago

0.4.19

6 years ago

0.4.18

6 years ago

0.4.17

6 years ago

0.4.16

6 years ago

0.4.15

6 years ago

0.4.14

6 years ago

0.4.13

6 years ago

0.4.12

6 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago