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

@@ -10,9 +10,8 @@
namespace App\Form\Toolbar;
use App\Form\Type\ActivityType;
use App\Form\Type\BeginDateType;
use App\Form\Type\CustomerType;
use App\Form\Type\EndDateType;
use App\Form\Type\DateRangeType;
use App\Form\Type\PageSizeType;
use App\Form\Type\ProjectType;
use App\Form\Type\UserRoleType;
@@ -115,20 +114,11 @@ abstract class AbstractToolbarForm extends AbstractType
/**
* @param FormBuilderInterface $builder
*/
protected function addStartDateChoice(FormBuilderInterface $builder)
protected function addDateRangeChoice(FormBuilderInterface $builder, $allowEmpty = true)
{
$builder->add('begin', BeginDateType::class, [
'required' => false,
]);
}
/**
* @param FormBuilderInterface $builder
*/
protected function addEndDateChoice(FormBuilderInterface $builder)
{
$builder->add('end', EndDateType::class, [
$builder->add('daterange', DateRangeType::class, [
'required' => false,
'allow_empty' => $allowEmpty,
]);
}

View File

@@ -26,8 +26,7 @@ class InvoiceToolbarForm extends AbstractToolbarForm
{
$this->addTemplateChoice($builder);
$this->addUserChoice($builder);
$this->addStartDateChoice($builder);
$this->addEndDateChoice($builder);
$this->addDateRangeChoice($builder);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
$this->addActivityChoice($builder);

View File

@@ -24,8 +24,7 @@ class TimesheetAdminToolbarForm extends TimesheetToolbarForm
$this->addTimesheetStateChoice($builder);
$this->addPageSizeChoice($builder);
$this->addUserChoice($builder);
$this->addStartDateChoice($builder);
$this->addEndDateChoice($builder);
$this->addDateRangeChoice($builder);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
$this->addActivityChoice($builder);

View File

@@ -26,8 +26,7 @@ class TimesheetToolbarForm extends AbstractToolbarForm
{
$this->addTimesheetStateChoice($builder);
$this->addPageSizeChoice($builder);
$this->addStartDateChoice($builder);
$this->addEndDateChoice($builder);
$this->addDateRangeChoice($builder);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
$this->addActivityChoice($builder);