Skip to content

Commit

Permalink
fix agenda bookmarks not visible (#536)
Browse files Browse the repository at this point in the history
it was limiting it based on current date but bookmarked events
might be shown anytime, so limit it to be max 10 days
from the start.

NHUB-335
  • Loading branch information
petrjasek authored Sep 8, 2023
1 parent 4a9b732 commit e750740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/agenda/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ const isBetweenDay = (day: moment.Moment, start: moment.Moment, end: moment.Mome
return day.isSameOrAfter(start) && testDay.isSameOrBefore(endDate);
}

return day.isBetween(startDate, endDate, 'day', '[]');
return testDay.isBetween(startDate, endDate, 'day', '[]');
};

/**
Expand Down Expand Up @@ -757,7 +757,7 @@ export function groupItems(items: any, activeDate: any, activeGrouping: any, fea
}

let key = null;
end = moment.min(end, minStart.clone().add(10, 'd')); // show each event for 10 days max not to destroy the UI
end = moment.min(end, start.clone().add(10, 'd')); // show each event for 10 days max not to destroy the UI

// use clone otherwise it would modify start and potentially also maxStart, moments are mutable
for (const day = start.clone(); day.isSameOrBefore(end, 'day'); day.add(1, 'd')) {
Expand Down

0 comments on commit e750740

Please sign in to comment.