1.6.2 • Published 6 years ago

instantjob-calendar v1.6.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Calendar for displaying shifts

This is the calendar used by InstantJob for displaying information about shifts.

Installation

npm install --save instantjob-calendar

Example

import React from 'react'
import Calendar from 'instantjob-calendar'

export default ({missions}) => (
  <Calendar
    missions={missions}
    get_mission_elements={({title, color, icon, informations, onClick}) => {
      return {title, color, icon, informations, onClick}
    }}
  />
)

Props API

missions

missions is a list of objects with an events key, itself a list of objects with a start and end keys (datetime values that moment understands)

missions = [{
  events: [{
    start: "2017-11-27T11:00:00.000+01:00",
    end: "2017-11-27T15:00:00.000+01:00",
  }],
}]

render_shift

render_shift is a function that takes as parameter the mission object from the missions props and an event for which the mission needs to be rendered and returns a rendered react element.

render_shift = (mission, {start, end}) => (
  <Shift
    {...mission}
    start={start}
    end={end}
  />
)

className, style

Style your component the way you want.

License

MIT

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago