There is already an open PR for comparison constraints that should also
solve this case: https://github.com/symfony/symfony/pull/790

Cheers,
Bernhard

--
Bernhard Schussek
Blog: http://webmozarts.com
Twitter: http://twitter.com/webmozart



2012/12/11 Baptiste DUPUCH <baptiste.dup...@gmail.com>

> I was also working on that idea where you can order only between
> myEarlierDate and myLaterDate.
> I don't know in which context you are working on but I had to exclude some
> days between the 2 dates in the case where the shop is closed.
>
> Don't hesitate to email me if you have any question.
> bapti...@cotelettes-tarteauxfraises.com
>
> Le lundi 10 décembre 2012 10:17:41 UTC+1, Julien Stoeffler a écrit :
>
>> Hi,
>>
>> (I've never contributed to an open source project but I always wanted,
>> maybe this will be the first time :-) )
>>
>> I've created a Date Order validator, and I'm wondering if I should push
>> it to the repository ?
>>
>> The idea is to use the constraint on your entity class :
>>
>> /**
>>  * @Assert\DateOrder(**earlierDatePropertyPath="**myEarlierDate",
>> laterDatePropertyPath="**myLaterDate")
>>  */
>> class AcmeEntity
>> {
>>     public $myEarlierDate;
>>     public $myLaterDate;
>> }
>>
>> It will ensure that the earlier date is indeed earlier than the later
>> one. It's useful for appointments, time slots,...
>> I believe it's quite general, even though it's not as general as the
>> official validators.
>>
>> It's requires no external library (hopefully !) and I've created an Unit
>> Test.
>>
>> So I was just wondering if you guys think it would be useful (it will
>> take me quite some time to see how it works, so I don't want to take the
>> effort if you're sure it's useless).
>>
>> Thanks
>>
>  --
> --
> If you want to report a vulnerability issue on Symfony, please read the
> procedure on http://symfony.com/security
>
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to symfony-devs@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-devs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
>
>
>

-- 
-- 
If you want to report a vulnerability issue on Symfony, please read the 
procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en


Reply via email to