Answer the question
In order to leave comments, you need to log in
How to make a filter by comparing the current date with the date from the add. properties?
$date = time();
$arFilter = array('PROPERTY_SEMINAR_STATUS' => 45,'ROPERTY_SEMINAR_END'=>?);
$APPLICATION->IncludeComponent(
"bitrix:news.list",
"obuchenie",
Array(
"IBLOCK_ID" => "24",
"PROPERTY_CODE" => Array(0=>"SEMINAR_START",1=>"SEMINAR_END",2=>"SEMINAR_CITY",3=>"SEMINAR_PLACE",4=>"SEMINAR_STATUS"),
"SORT_BY1" => "ACTIVE_FROM",
"SORT_BY2" => "SORT",
"SORT_ORDER1" => "DESC",
"SORT_ORDER2" => "ASC",
"FILTER_NAME" => "arFilter",
"CACHE_FILTER" => "Y"
)
);
Answer the question
In order to leave comments, you need to log in
According to documentation :
The filter values are a single value or an array of values. To exclude empty values, you must use false.
Optional. By default, entries are not filtered.
Note 1: (by setting the filter for the "Date/Time" type property): the Date/Time type property is stored as a string with a date in the YYYY-MM-DD HH:MI:SS format. Accordingly, sorting by the value of such a property will work correctly, but the value for filtering is formed like this: $cat_filter[">"."PROPERTY_available"] = date("Ymd");
Note 2: When using the filter check type "><" for null-terminated integers, you must use the field type number or the delimiter "," for decimal values (for example, 20000.00).">PROPERTY_SEMINAR_END" => date('Y-m-d)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question