Added date translator
This commit is contained in:
@@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\Date;
|
|||||||
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\NotEqualTo;
|
use Symfony\Component\Validator\Constraints\NotEqualTo;
|
||||||
|
use Thelia\Coupon\ExpirationDateTransformer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow to build a form Coupon
|
* Allow to build a form Coupon
|
||||||
@@ -90,14 +91,16 @@ class CouponCreationForm extends BaseForm
|
|||||||
array()
|
array()
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
'expirationDate',
|
$this->formBuilder->create(
|
||||||
'text',
|
'expirationDate',
|
||||||
array(
|
'text',
|
||||||
'constraints' => array(
|
array(
|
||||||
new NotBlank(),
|
'constraints' => array(
|
||||||
new Date()
|
new NotBlank(),
|
||||||
|
//new Date()
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)->addViewTransformer(new ExpirationDateTransformer())
|
||||||
)
|
)
|
||||||
->add(
|
->add(
|
||||||
'isCumulative',
|
'isCumulative',
|
||||||
|
|||||||
Reference in New Issue
Block a user