W
W
WebforSelf2022-01-09 19:36:07
1C-Bitrix
WebforSelf, 2022-01-09 19:36:07

How to exclude items with a start date for an event that has passed?

Friends, such a question, on the main page I displayed the elements through the bitix:news.list component.
It turns out that I sort them in ascending order, and the task is as follows, so that it shows only those elements whose
event start date has not yet come or has come today.
For example, there is an element
Name - event 1. / Event start date - 01/11/2022.
Name - event 2. / Event start date - 01/09/2022.
Name - event 3. / Event start date - 01/05/2022.

In sorting, I specify by date in ascending order, but since today is 01/09/2022
Then events are displayed in this sorting
Event 2
Event 1
And event 3, because it has already passed, it does not participate in the output.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WebforSelf, 2022-01-10
@WebforSelf

The task turned out to be easy to solve.
In the component parameters in the field add a filter - arrFilter
And before the output of the component

<?$GLOBALS['arrFilter']['>=DATE_ACTIVE_TO'] = date("d.m.Y");?>

Ready

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question