Skip to content

Commit

Permalink
Respect date filter in event list for multi day events (#2007)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Jul 1, 2024
1 parent b3a0cc1 commit 23407e3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/apps/Planning/PlanningList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {ITEM_TYPE} from '../../constants';

import {ListPanel} from '../../components/Main';
import {PlanningListSubNav} from './PlanningListSubNav';
import moment from 'moment';

interface IProps {
groups: Array<{
Expand Down Expand Up @@ -185,7 +186,17 @@ export class PlanningListComponent extends React.PureComponent<IProps> {
<React.Fragment>
<PlanningListSubNav />
<ListPanel
groups={groups}
groups={(() => {
const dateFilter = currentSearch.advancedSearch?.dates?.start;

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 23407e3

Please sign in to comment.