react-big-calendar

gcal/outlook like calendar component

  • 所有者: jquense/react-big-calendar
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

react-big-calendar

An events calendar component built for React and made for modern browsers (read: IE10+) and uses flexbox over the classic tables-ception approach.

DEMO and Docs

Inspired by Full Calendar.

Use and Setup

yarn add react-big-calendar or npm install --save react-big-calendar

Include react-big-calendar/lib/css/react-big-calendar.css for styles, and make sure your calendar's container
element has a height, or the calendar won't be visible. To provide your own custom styling, see the Custom Styling topic.

Starters

Run examples locally

$ git clone git@github.com:intljusticemission/react-big-calendar.git
$ cd react-big-calendar
$ yarn
$ yarn examples

Localization and Date Formatting

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:

Moment.js

import { Calendar, momentLocalizer } from 'react-big-calendar'
import moment from 'moment'

const localizer = momentLocalizer(moment)

const MyCalendar = props => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

Globalize.js v0.1.1

import { Calendar, globalizeLocalizer } from 'react-big-calendar'
import globalize from 'globalize'

const localizer = globalizeLocalizer(globalize)

const MyCalendar = props => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

date-fns 2.0

import { Calendar, dateFnsLocalizer } from 'react-big-calendar'
import format from 'date-fns/format'
import parse from 'date-fns/parse'
import startOfWeek from 'date-fns/startOfWeek'
import getDay from 'date-fns/getDay'
const locales = {
  'en-US': require('date-fns/locale/en-US'),
}
const localizer = dateFnsLocalizer({
  format,
  parse,
  startOfWeek,
  getDay,
  locales,
})

const MyCalendar = props => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

Custom Styling

Out of the box you can include the compiled css files and be up and running. But, sometimes, you may want to style
Big Calendar to match your application styling. For this reason SASS files are included with Big Calendar.

  @import 'react-big-calendar/lib/sass/styles';
  @import 'react-big-calendar/lib/addons/dragAndDrop/styles'; // if using DnD

SASS implementation provides a variables file containing color and sizing variables that you can
update to fit your application. Note: Changing and/or overriding styles can cause rendering issues with your
Big Calendar. Carefully test each change accordingly.

Join us on Reactiflux Discord

Join us on Reactiflux Discord community under the channel #react-big-calendar if you have any questions.

主要指标

概览
名称与所有者jquense/react-big-calendar
主编程语言JavaScript
编程语言JavaScript (语言数: 6)
平台
许可证MIT License
所有者活动
创建于2015-08-22 02:56:58
推送于2025-06-16 17:34:52
最后一次提交2025-06-16 17:32:40
发布数197
最新版本名称v1.19.4 (发布于 )
第一版名称v0.4.0 (发布于 2015-09-03 14:55:19)
用户参与
星数8.4k
关注者数80
派生数2.3k
提交数0.9k
已启用问题?
问题数1841
打开的问题数335
拉请求数464
打开的拉请求数70
关闭的拉请求数366
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?