Added date translator

This commit is contained in:
Franck Allimant
2014-05-02 16:55:39 +02:00
parent 8ce6cdbae0
commit 989a44591f

View File

@@ -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(
$this->formBuilder->create(
'expirationDate', 'expirationDate',
'text', 'text',
array( array(
'constraints' => array( 'constraints' => array(
new NotBlank(), new NotBlank(),
new Date() //new Date()
) )
) )
)->addViewTransformer(new ExpirationDateTransformer())
) )
->add( ->add(
'isCumulative', 'isCumulative',