diff --git a/src/EventEndingRow.js b/src/EventEndingRow.js index fd2d8a699..fc32457a7 100644 --- a/src/EventEndingRow.js +++ b/src/EventEndingRow.js @@ -7,7 +7,7 @@ import range from 'lodash/range' let isSegmentInSlot = (seg, slot) => seg.left <= slot && seg.right >= slot let eventsInSlot = (segments, slot) => - segments.filter((seg) => isSegmentInSlot(seg, slot)).length + segments.filter((seg) => isSegmentInSlot(seg, slot)).map((seg) => seg.event) class EventEndingRow extends React.Component { render() { @@ -68,16 +68,17 @@ class EventEndingRow extends React.Component { let { segments } = this.props return range(slot, slot + span).every((s) => { - let count = eventsInSlot(segments, s) + const count = eventsInSlot(segments, s).length return count === 1 }) } renderShowMore(segments, slot) { - let { localizer } = this.props - let count = eventsInSlot(segments, slot) - + let { localizer, slotMetrics } = this.props + const events = slotMetrics.getEventsForSlot(slot) + const remainingEvents = eventsInSlot(segments, slot) + const count = remainingEvents.length return count ? ( ) : ( false diff --git a/stories/props/messages.mdx b/stories/props/messages.mdx index 2bd0e8be1..d23cbd4b1 100644 --- a/stories/props/messages.mdx +++ b/stories/props/messages.mdx @@ -27,8 +27,12 @@ defualts agenda: 'Agenda', noEventsInRange: 'There are no events in this range.', - - showMore: total => `+${total} more`, + /** + * params {total} count of remaining events + * params {remainingEvents} remaining events + * params {events} all events in day + */ + showMore: (total, remainingEvents, events) => `+${total} más`, } ```