form improvement

using theme clone
This commit is contained in:
Kevin Papst
2016-11-13 22:19:18 +01:00
parent cc269d3142
commit aaa2fffa08
22 changed files with 411 additions and 60 deletions

View File

@@ -39,8 +39,10 @@ class TimesheetRepository extends EntityRepository
*/
protected function queryThisMonth($select, User $user = null)
{
$end = new DateTime();
$begin = $end->sub(new \DateInterval("P30D")); // FIXME last month is not last 30 days
$end = new DateTime('last day of this month');
$end->setTime(23, 59, 59);
$begin = new DateTime('first day of this month');
$begin->setTime(0,0,0);
return $this->queryTimeRange($select, $begin, $end, $user);
}
@@ -59,7 +61,7 @@ class TimesheetRepository extends EntityRepository
$qb->select($select)
->from('TimesheetBundle:Timesheet', 't')
->where($qb->expr()->gt('t.begin', ':from'))
->andWhere($qb->expr()->gt('t.end', ':to'))
->andWhere($qb->expr()->lt('t.end', ':to'))
->setParameter('from', $begin, Type::DATETIME)
->setParameter('to', $end, Type::DATETIME);