Skip to content

Commit

Permalink
If a date filter hasnt been set return default option
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Jul 1, 2024
1 parent f71c19f commit 48f3e53
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions client/apps/Planning/PlanningList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,17 @@ export class PlanningListComponent extends React.PureComponent<IProps> {
<React.Fragment>
<PlanningListSubNav />
<ListPanel
groups={groups.filter((group) => {
const groupDateToMoment = moment(group.date);
groups={(() => {
const dateFilter = currentSearch.advancedSearch?.dates?.start;

return dateFilter != null
? groupDateToMoment.isSameOrAfter(dateFilter)
: false;
})}
if (dateFilter != null) {
return groups.filter((group) =>
moment(group.date).isSameOrAfter(dateFilter),
);
}

return groups;
})()}
onItemClick={openPreview}
onDoubleClick={edit}
agendas={agendas}
Expand Down

0 comments on commit 48f3e53

Please sign in to comment.