Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ReactEventCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ class EventCalendar extends React.Component {
if (eventStartInView || eventEndInView) {
// Asserts event's first or last day is visible in this month view
eventMeta.isVisibleInView = true;
} else if (eventStart.month < this.props.month && eventEnd.month > this.props.month) {
} else if (
(eventStart.year < this.props.year || (eventStart.year === this.props.year && eventStart.month < this.props.month)) &&
(eventEnd.year > this.props.year || (eventEnd.year === this.props.year && eventEnd.month > this.props.month))
) {
// Asserts at least part of month is
eventMeta.isVisibleInView = true;
}
Expand Down Expand Up @@ -150,10 +153,10 @@ class EventCalendar extends React.Component {
getCalendarDayObject(date) {
const dateArray = date.split('-');
return {
year: dateArray[0],
year: parseInt(dateArray[0], 10),
// Subtract 1 from month to allow for human declared months
month: dateArray[1] - 1,
day: dateArray[2],
month: parseInt(dateArray[1], 10) - 1,
day: parseInt(dateArray[2], 10),
};
}

Expand Down