AND learnings.start_date BETWEEN :date1 AND :date2
AND learnings.finish_date BETWEEN :date1 AND :date2
то выборка работает.start_date
и finish_date
и фильтровать их как один? $date1 = (new DateTime($_POST['date1']))->format('Y-m-d 00:00:00');
$date2 = (new DateTime($_POST['date2']))->format('Y-m-d 23:59:59');
if(empty($_POST['date2'])){
$date2 = (new DateTime($date1))->format('Y-m-d 23:59:59');
}
echo $date1;//2020-12-05 00:00:00
echo $date2;//2020-12-05 23:59:59