Skip to content

Commit

Permalink
fix searching by publish date - suport only day
Browse files Browse the repository at this point in the history
  • Loading branch information
ahilles107 committed Feb 24, 2015
1 parent 3079393 commit 01ecaa8
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -184,8 +184,14 @@ public function getArticlesByIds($articleSearchCriteria, $ids = array(), $onlyPu
}

if ($articleSearchCriteria->publish_date) {
$queryBuilder->andWhere('a.published = :publish_date')
->setParameter('publish_date', $articleSearchCriteria->publish_date);
$startDate = new \DateTime($articleSearchCriteria->publish_date);
$endDate = new \DateTime($articleSearchCriteria->publish_date);
$endDate->modify('+ 1 day');

$queryBuilder->andWhere('a.published >= :publish_date_start')
->setParameter('publish_date_start', $startDate);
$queryBuilder->andWhere('a.published < :publish_date_end')
->setParameter('publish_date_end', $endDate);
}

if ($articleSearchCriteria->published_after) {
Expand Down

0 comments on commit 01ecaa8

Please sign in to comment.