Skip to content

Commit

Permalink
Comment tweaks and remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
jkriegshauser committed Jan 22, 2024
1 parent dd47ee4 commit ec31502
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions modules/default/calendar/calendarfetcherutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const CalendarFetcherUtils = {
if (event.recurrences !== undefined) {
for (let dateKey in event.recurrences) {
// Only add dates that weren't already in the range we added from the rrule so that
// we don't double-add those events. Unfortunately dates.includes doesn't do an exact match.
// we don't double-add those events.
let d = new Date(dateKey);
if (!moment(d).isBetween(pastMoment, futureMoment)) {
dates.push(d);
Expand All @@ -351,7 +351,7 @@ const CalendarFetcherUtils = {
}

// Lastly, sometimes rrule doesn't include the event.start even if it is in the requested range. Ensure
// inclusion here.
// inclusion here. Unfortunately dates.includes() doesn't find it so we have to do forEach().
{
let found = false;
dates.forEach((d) => { if (d.valueOf() === event.start.valueOf()) found = true; });
Expand All @@ -367,10 +367,6 @@ const CalendarFetcherUtils = {
let curEvent = event;
let showRecurrence = true;

if (date < pastLocal || date > futureLocal) {
continue;
}

startMoment = moment(date);

// Remove the time information of each date by using its substring, using the following method:
Expand Down

0 comments on commit ec31502

Please sign in to comment.