Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # react-big-calendar
  2. An events calendar component built for React and made for modern browsers (read: IE10+) and uses flexbox over the classic tables-ception approach.
  3. [**DEMO and Docs**](http://intljusticemission.github.io/react-big-calendar/examples/index.html)
  4. Inspired by [Full Calendar](http://fullcalendar.io/).
  5. ## Use and Setup
  6. `yarn add react-big-calendar` or `npm install --save react-big-calendar`
  7. Include `react-big-calendar/lib/css/react-big-calendar.css` for styles, and make sure your calendar's container
  8. element has a height, or the calendar won't be visible. To provide your own custom styling, see the [Custom Styling](#custom-styling) topic.
  9. ## Starters
  10. - [react-big-calendar](https://github.com/arecvlohe/rbc-starter)
  11. - [react-big-calendar with drag and drop](https://github.com/arecvlohe/rbc-with-dnd-starter)
  12. ## Run examples locally
  13. ```sh
  14. $ git clone git@github.com:intljusticemission/react-big-calendar.git
  15. $ cd react-big-calendar
  16. $ yarn
  17. $ yarn examples
  18. ```
  19. - Open [localhost:3000/examples/index.html](http://localhost:3000/examples/index.html).
  20. ### Localization and Date Formatting
  21. `react-big-calendar` includes two options for handling the date formatting and culture localization, depending
  22. on your preference of DateTime libraries. You can use either the [Moment.js](http://momentjs.com/) or [Globalize.js](https://github.com/jquery/globalize) localizers.
  23. Regardless of your choice, you **must** choose a localizer to use this library:
  24. #### Moment.js
  25. ```js
  26. import { Calendar, momentLocalizer } from 'react-big-calendar'
  27. import moment from 'moment'
  28. const localizer = momentLocalizer(moment)
  29. const MyCalendar = props => (
  30. <div>
  31. <Calendar
  32. localizer={localizer}
  33. events={myEventsList}
  34. startAccessor="start"
  35. endAccessor="end"
  36. />
  37. </div>
  38. )
  39. ```
  40. #### Globalize.js v0.1.1
  41. ```js
  42. import { Calendar, globalizeLocalizer } from 'react-big-calendar'
  43. import globalize from 'globalize'
  44. const localizer = globalizeLocalizer(globalize)
  45. const MyCalendar = props => (
  46. <div>
  47. <Calendar
  48. localizer={localizer}
  49. events={myEventsList}
  50. startAccessor="start"
  51. endAccessor="end"
  52. />
  53. </div>
  54. )
  55. ```
  56. ## Custom Styling
  57. Out of the box you can include the compiled css files and be up and running. But, sometimes, you may want to style
  58. Big Calendar to match your application styling. For this reason SASS files are included with Big Calendar.
  59. ```
  60. @import 'react-big-calendar/lib/sass/styles';
  61. @import 'react-big-calendar/lib/addons/dragAndDrop/styles'; // if using DnD
  62. ```
  63. SASS implementation provides a `variables` file containing color and sizing variables that you can
  64. update to fit your application. _Note:_ Changing and/or overriding styles can cause rendering issues with your
  65. Big Calendar. Carefully test each change accordingly.
  66. ## Join us on Reactiflux Discord
  67. Join us on [Reactiflux Discord](https://discord.gg/uJsgpkC) community under the channel #react-big-calendar if you have any questions.