Is there any way to use @Range to validate a range of dates in Regula? (ditto @Min and @Max)
Or do I need to use @Custom?
@Range(min=
and
@Range(max=
do not seem to accept anything of the type Date - only numbers or strings.
Unfortunately @Range only accepts numbers. I think you can do something like this though:
<input type="hidden"
name="date"
id="date"
data-constraints="
@Future(date='2000/1/1', format='YMD')
@Past(date='2010/1/1', format='YMD')"
/>
This ensures that the date is after 2000/1/1 and before 2010/1/1 (i.e., in between). I didn't document the date parameter because I don't think I had implemented it when I wrote the documentation. Sorry; the documentation is a bit behind because I'm working on rolling version 1.3 of Regula out, that will have a lot more goodies. I'll be getting started on updating the documentation soon!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With