Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cutterbl committed Feb 6, 2020
2 parents c738deb + 7b5a6a7 commit 8fb4b14
Show file tree
Hide file tree
Showing 79 changed files with 1,966 additions and 941 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"esm": {
"presets": [
["jason", { "modules": false }]
],
"plugins": [
["babel-plugin-transform-rename-import", {
replacements: [{ original: "lodash", replacement: "lodash-es" }]
}]
]
}
}
Expand Down
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ env:
es6: true
rules:
global-require: off
no-unused-vars: [2, {
no-console: ['error', {
allow: ['warn', 'error', 'info']
}]
no-unused-vars: ['error', {
vars: all,
args: after-used,
varsIgnorePattern: ^_,
Expand Down
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Install Dependencies
run: yarn install

- name: Unit Test & Linting
run: yarn test

- name: Build
run: yarn build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@master
id: semantic
with:
branch: master
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test

on: [pull_request]


jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Install Dependencies
run: yarn install

- name: Unit Test & Linting
run: yarn test

- name: Build
run: yarn build
24 changes: 12 additions & 12 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"./dist/react-big-calendar.js": {
"bundled": 561648,
"minified": 171367,
"gzipped": 50382
"bundled": 501317,
"minified": 146786,
"gzipped": 44762
},
"./dist/react-big-calendar.min.js": {
"bundled": 497985,
"minified": 152018,
"gzipped": 45872
"bundled": 439004,
"minified": 127972,
"gzipped": 40409
},
"dist/react-big-calendar.esm.js": {
"bundled": 169583,
"minified": 81478,
"gzipped": 20083,
"bundled": 168678,
"minified": 80552,
"gzipped": 19913,
"treeshaked": {
"rollup": {
"code": 62961,
"import_statements": 1466
"code": 58283,
"import_statements": 1578
},
"webpack": {
"code": 66479
"code": 62787
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
sudo: false
language: node_js
node_js:
- stable
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- node
branches:
only:
- master
231 changes: 151 additions & 80 deletions CHANGELOG.md

Large diffs are not rendered by default.

48 changes: 41 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ Regardless of your choice, you **must** choose a localizer to use this library:
#### Moment.js

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

const localizer = BigCalendar.momentLocalizer(moment)
const localizer = momentLocalizer(moment)

const MyCalendar = props => (
<div>
<BigCalendar
<Calendar
localizer={localizer}
events={myEventsList}
startAccessor="start"
endAccessor="end"
style={{ height: 500 }}
/>
</div>
)
Expand All @@ -59,18 +60,51 @@ const MyCalendar = props => (
#### Globalize.js v0.1.1

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

const localizer = BigCalendar.globalizeLocalizer(globalize)
const localizer = globalizeLocalizer(globalize)

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

#### date-fns 2.0

```js
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>
)
Expand All @@ -83,7 +117,7 @@ Big Calendar to match your application styling. For this reason SASS files are i

```
@import 'react-big-calendar/lib/sass/styles';
@import 'react-big-calendar/addons/dragAndDrop/styles'; // if using DnD
@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
Expand Down
4 changes: 4 additions & 0 deletions examples/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Card from './Card'
import ExampleControlSlot from './ExampleControlSlot'
import Basic from './demos/basic'
import Selectable from './demos/selectable'
import CreateEventWithNoOverlap from './demos/createEventWithNoOverlap'
import Cultures from './demos/cultures'
import Popup from './demos/popup'
import Rendering from './demos/rendering'
Expand All @@ -37,13 +38,15 @@ let demoRoot =
const EXAMPLES = {
basic: 'Basic Calendar',
selectable: 'Create events',
createEventWithNoOverlap: 'Create events with no-overlap algorithm',
cultures: 'Localization',
popup: 'Show more via a popup',
timeslots: 'Custom Time Grids',
rendering: 'Customized Component Rendering',
customView: 'Custom Calendar Views',
resource: 'Resource Scheduling',
dnd: 'Addon: Drag and drop',
dndresource: 'Resource Drag and drop',
dndOutsideSource: 'Addon: Drag and drop (from outside calendar)',
}

Expand Down Expand Up @@ -81,6 +84,7 @@ class Example extends React.Component {
dnd: Dnd,
dndresource: DndResource,
dndOutsideSource: DndOutsideSource,
createEventWithNoOverlap: CreateEventWithNoOverlap,
}[selected]

return (
Expand Down
6 changes: 3 additions & 3 deletions examples/Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ Choose the localizer that best suits your needs, or write your own. Whatever you
before you can use the calendar (you only need to set it up once).

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

// Setup the localizer by providing the moment (or globalize) Object
// to the correct localizer.
const localizer = BigCalendar.momentLocalizer(moment) // or globalizeLocalizer
const localizer = momentLocalizer(moment) // or globalizeLocalizer

const MyCalendar = props => (
<div>
<BigCalendar
<Calendar
localizer={localizer}
events={myEventsList}
startAccessor="start"
Expand Down
Loading

0 comments on commit 8fb4b14

Please sign in to comment.