Answer the question
In order to leave comments, you need to log in
How to display news in one day?
Hello everybody. I have a news page. I send a request with a get parameter and specify the dates in it.
Request like ?from=11/21/2018&to=11/23/2018.
On the same page I get this date and add it to the filter.
global $arrFilter; $arrFilter = array();
if ($dateStart && $dateEnd && $dateStart != $dateEnd){
$arrFilter[] = array(
"LOGIC" => "AND",
array(">=DATE_ACTIVE_FROM" => $dateStart),
array("<=DATE_ACTIVE_FROM" => $dateEnd),
);
}else if($dateStart && $dateEnd && $dateStart == $dateEnd) {
echo $dateEnd;
// $dateStart
$arrFilter[] = array(
"LOGIC" => "AND",
array(">=DATE_ACTIVE_FROM" => '21.11.2018'),
array("<=DATE_ACTIVE_FROM" => '23.11.2018'),
);
// так сработает, но это я сделал для того что бы убедиться в том что вообще работает.
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question