userfrosting/fortress

Allow date validation

Opened this issue · 3 comments

Date fields are often used in forms. Please add date format validation to fortress.

Dates come in many formats. What do you propose?

jQueryvalidation has the dateISO method: https://jqueryvalidation.org/dateISO-method/
Valitron has a generic date method, which accepts any parsable date string, or a DateTime object: https://github.com/vlucas/valitron/blob/master/src/Valitron/Validator.php#L563-L580

Can we use valitron's date method validations?

Since fortress is using Valitron, can these be used without any changes to
the code? Some examples or documentation would be appreciated.

Btw, we are using userfrosting and it's great!

Saket Khanna
Founder, MealTango.com

Why I started MealTango http://bit.ly/why-started-mealtango
About MealTango http://bit.ly/eml-about-mealtango
MealTango featured in the AFR http://bit.ly/afr-mealtango
MealTango at the Great Food Show http://bit.ly/eml-gfs-mealtango
MealTango mentioned in 'A Personal Guide to India and Bhutan
http://bit.ly/eml-personal-guide-christine-manfield-mealtango' by
Masterchef Guest Chef & Judge Christine Manfield
Masterchef Judge and Celeb Chef Ranveer Brar felicitates MealTango
Homechef http://bit.ly/eml-chef-ranveer-brar
BBC Good Food Magazine editor felicitates MealTango Homechef
Just some Customer Love http://bit.ly/mt-feedback-postcard! Okay- some
more http://bit.ly/mt-testimonials.

MealTango on Facebook http://bit.ly/eml-fb-mealtango
MealTango on Twitter http://bit.ly/eml-twitter-mealtango

On Tue, Jul 19, 2016 at 6:50 PM, Alex Weissman notifications@github.com
wrote:

Dates come in many formats. What do you propose?

jQueryvalidation has the dateISO method:
https://jqueryvalidation.org/dateISO-method/
Valitron has a generic date method, which accepts any parsable date
string, or a DateTime object:
https://github.com/vlucas/valitron/blob/master/src/Valitron/Validator.php#L563-L580


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFBnHR6HIsF2WV53rK7AGNHwMGz7-ujAks5qXM8CgaJpZM4JPcwu
.

Glad UF is working out for your business - I definitely had startups and small businesses in mind when I created it. Would you be interested in featuring your site in our gallery?

As for using Valitron's date method, sadly, the ServerSideValidator object (which itself extends Valitron) is not exposed through HTTPRequestFortress. However, we could probably expose it without breaking any backwards-compatibility. Let me see what I can do.