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(
'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',