added daterange-picker and localized date-inputs (#540)

This commit is contained in:
Kevin Papst
2019-02-03 21:24:30 +01:00
committed by GitHub
parent aae9183de6
commit 062735c9e3
37 changed files with 1058 additions and 264 deletions

View File

@@ -11,6 +11,7 @@ namespace App\Repository\Query;
use App\Entity\Activity;
use App\Entity\User;
use App\Form\Model\DateRange;
/**
* Can be used for advanced timesheet repository queries.
@@ -44,13 +45,14 @@ class TimesheetQuery extends ActivityQuery
*/
protected $state = self::STATE_ALL;
/**
* @var \DateTime
* @var DateRange
*/
protected $begin;
/**
* @var \DateTime
*/
protected $end;
protected $dateRange;
public function __construct()
{
$this->dateRange = new DateRange();
}
/**
* @return User
@@ -123,7 +125,7 @@ class TimesheetQuery extends ActivityQuery
*/
public function getBegin()
{
return $this->begin;
return $this->dateRange->getBegin();
}
/**
@@ -132,7 +134,7 @@ class TimesheetQuery extends ActivityQuery
*/
public function setBegin($begin)
{
$this->begin = $begin;
$this->dateRange->setBegin($begin);
return $this;
}
@@ -142,7 +144,7 @@ class TimesheetQuery extends ActivityQuery
*/
public function getEnd()
{
return $this->end;
return $this->dateRange->getEnd();
}
/**
@@ -151,7 +153,26 @@ class TimesheetQuery extends ActivityQuery
*/
public function setEnd($end)
{
$this->end = $end;
$this->dateRange->setEnd($end);
return $this;
}
/**
* @return DateRange
*/
public function getDateRange(): DateRange
{
return $this->dateRange;
}
/**
* @param DateRange $dateRange
* @return TimesheetQuery
*/
public function setDateRange(DateRange $dateRange)
{
$this->dateRange = $dateRange;
return $this;
}