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 Oct 26, 2021
2 parents e1df00f + 45a07ca commit c75ad1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ element has a height, or the calendar won't be visible. To provide your own cust

- [react-big-calendar](https://github.com/arecvlohe/rbc-starter)
- [react-big-calendar with drag and drop](https://github.com/arecvlohe/rbc-with-dnd-starter)
- [react-big-calendar with TypeScript and React hooks bundled with Vite](https://github.com/christopher-caldwell/react-big-calendar-demo)

## Run examples locally

Expand Down
30 changes: 19 additions & 11 deletions src/Agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import { inRange } from './utils/eventLevels'
import { isSelected } from './utils/selection'

function Agenda({
selected,
getters,
accessors,
localizer,
components,
length,
date,
events,
getters,
length,
localizer,
onDoubleClickEvent,
onSelectEvent,
selected,
}) {
const headerRef = useRef(null)
const dateColRef = useRef(null)
Expand Down Expand Up @@ -76,7 +78,13 @@ function Agenda({
>
{first}
<td className="rbc-agenda-time-cell">{timeRangeLabel(day, event)}</td>
<td className="rbc-agenda-event-cell">
<td
className="rbc-agenda-event-cell"
onClick={e => onSelectEvent && onSelectEvent(event, e)}
onDoubleClick={e =>
onDoubleClickEvent && onDoubleClickEvent(event, e)
}
>
{Event ? <Event event={event} title={title} /> : title}
</td>
</tr>
Expand Down Expand Up @@ -197,16 +205,16 @@ function Agenda({
}

Agenda.propTypes = {
events: PropTypes.array,
date: PropTypes.instanceOf(Date),
length: PropTypes.number.isRequired,

selected: PropTypes.object,

accessors: PropTypes.object.isRequired,
components: PropTypes.object.isRequired,
date: PropTypes.instanceOf(Date),
events: PropTypes.array,
getters: PropTypes.object.isRequired,
length: PropTypes.number.isRequired,
localizer: PropTypes.object.isRequired,
onSelectEvent: PropTypes.func,
onDoubleClickEvent: PropTypes.func,
selected: PropTypes.object,
}

Agenda.defaultProps = {
Expand Down

0 comments on commit c75ad1a

Please sign in to comment.