An events calendar component built for React and made for modern browsers (read: IE10+) and uses flexbox over the classic tables-ception approach.
Inspired by [Full Calendar](http://intljusticemission.github.io/react-big-calendar/examples/index.html and http://fullcalendar.io/).
npm install kandooit_calendar --save
Include kandooit_calendar/lib/css/react-big-calendar.css
for styles.
import withDragAndDrop from 'kandooit_calendar/lib/addons/dragAndDrop';
BigCalendar.setLocalizer( BigCalendar.momentLocalizer(moment) );
const DragAndDropCalendar = withDragAndDrop(BigCalendar); then use this DragAndDropCalendar like below:
<DragAndDropCalendar
selectable
resizable
min={am8}
max={pm8}
timeslots={1}
step={60}
events={this.state.appointments}
statusHeadings={this.props.MasterStatusHeadings}
resources={this.state.resource_list}
defaultView={this.filter.currentView}
scrollToTime={new Date(1970, 1, 1, 6)}
defaultDate={new Date()}
date={this.state.schedulerDate}
formats={formats}
views={scheduler_view}
onEventResize={this.resizeAppointment}
draggableAccessor= 'isDragable'
resizableAccessor= 'isDragable'
onEventDrop={(event) => this.moveAppointment(event)}
onSelectEvent={(event) => this.openDialog(event)}
onView={(e) => this.handleStaffView(e)}
eventPropGetter={(event, date, end, isSelected) => this.eventStyleGetter(event)}
onSelectSlot={(slotInfo) => this.openDialog(slotInfo)}
onNavigate={this.onNavigateMonth}
usersAvailability={filteredUsersAvailability}
/>
- Clone this repository
- Retrieve dependencies:
npm install
- Start:
npm run examples
- Open localhost:3003/examples/index.html.
react-big-calendar
includes two options for handling the date formatting and culture localization, depending
on your preference of DateTime libraries. You can use either the Moment.js or Globalize.js localizers.
Regardless of your choice, you must choose a localizer to use this library:
import BigCalendar from 'react-big-calendar';
import moment from 'moment';
BigCalendar.setLocalizer(
BigCalendar.momentLocalizer(moment)
);
import BigCalendar from 'react-big-calendar';
import globalize from 'globalize';
BigCalendar.setLocalizer(
BigCalendar.globalizeLocalizer(globalize)
);