forked from jquense/react-big-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add background events feature (jquense#1851)
* feat: Add background events * Clean up time grid background event * Update time grid background event name * Add storybook example * Fix typo in documentation * Remove unused props in documentation * Clean up Background Events feature in preparation for merge * Remove package-lock.json * Code clean up * jquense#1727 Add better background events example and address code review * Remove changes not related to the background event feature * Fix <Calendar /> background event story * Fix background event width calculation Co-authored-by: rrjoson <rrjoson08@gmail.com> Co-authored-by: Jeremy Mauzy <jmauzy@alertmd.com>
- Loading branch information
1 parent
8ffe39d
commit e797ab3
Showing
13 changed files
with
202 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default [ | ||
{ | ||
id: 0, | ||
title: 'Available for Clients', | ||
start: new Date(2015, 3, 13, 6), | ||
end: new Date(2015, 3, 13, 18), | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
import { Calendar, Views } from 'react-big-calendar' | ||
import events from '../events' | ||
import backgroundEvents from '../backgroundEvents' | ||
import * as dates from '../../src/utils/dates' | ||
|
||
let allViews = Object.keys(Views).map(k => Views[k]) | ||
|
||
let Basic = ({ localizer }) => ( | ||
<Calendar | ||
events={events} | ||
defaultView={Views.DAY} | ||
views={allViews} | ||
step={60} | ||
showMultiDayTimes | ||
max={dates.add(dates.endOf(new Date(2015, 17, 1), 'day'), -1, 'hours')} | ||
defaultDate={new Date(2015, 3, 13)} | ||
localizer={localizer} | ||
backgroundEvents={backgroundEvents} | ||
dayLayoutAlgorithm={'no-overlap'} | ||
/> | ||
) | ||
|
||
export default Basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.