Skip to content

Commit

Permalink
Respect date filter in event list for multi day events
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Jun 28, 2024
1 parent a8262c5 commit f71c19f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 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,14 @@ export class PlanningListComponent extends React.PureComponent<IProps> {
<React.Fragment>
<PlanningListSubNav />
<ListPanel
groups={groups}
groups={groups.filter((group) => {
const groupDateToMoment = moment(group.date);
const dateFilter = currentSearch.advancedSearch?.dates?.start;

return dateFilter != null
? groupDateToMoment.isSameOrAfter(dateFilter)
: false;
})}
onItemClick={openPreview}
onDoubleClick={edit}
agendas={agendas}
Expand Down

0 comments on commit f71c19f

Please sign in to comment.