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.
- Loading branch information
Showing
9 changed files
with
31,971 additions
and
7 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
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,42 @@ | ||
## <a id='intro' href='#intro'>Getting Started</a> | ||
|
||
You can install `react-big-calendar` via npm: | ||
|
||
```js | ||
npm i --save react-big-calendar | ||
``` | ||
|
||
Styles can be found at: `react-big-calendar/lib/css/react-big-calendar.css`, and should be included on the page | ||
with the calendar component. | ||
|
||
Date internationalization and localization is __hard__ and `react-big-calendar` doesn't even attempt to | ||
solve that problem. Instead you can use one of the many excellent solutions already | ||
out there, via adapters called "localizers". Big Calendar comes with two localizers for use | ||
with [Globalize.js](https://github.com/jquery/globalize) (v0.1.0 supported) or [Moment.js](http://momentjs.com/). | ||
|
||
Choose the localizer that best suits your needs, or write your own. Whatever you do, you'll need to set it up | ||
before you can use the calendar (you only need to set it up once). | ||
|
||
```jsx | ||
import BigCalendar from 'react-big-calendar'; | ||
import moment from 'moment'; | ||
|
||
// Setup the localizer by providing the moment (or globalize) Object | ||
// to the correct localizer. | ||
BigCalendar.momentLocalizer(moment); // or globalizeLocalizer | ||
|
||
let MyCalendar = props => ( | ||
<div> | ||
<BigCalendar | ||
events={myEventsList} | ||
startAccessor='startDate' | ||
endAccessor='endDate' | ||
/> | ||
</div> | ||
); | ||
``` | ||
|
||
Once you've configured a localizer, the Calendar is ready to accept `dateFormat` props. These props determine | ||
how dates will be displayed throughout the component and are specific to the localizer of your choice. For | ||
instance if you are using the Moment localizer, | ||
then any [Moment format pattern](http://momentjs.com/docs/#/displaying/format/) is valid! |
Oops, something went wrong.