Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Allow date validation #13

Open
senseq opened this issue Jul 19, 2016 · 3 comments
Open

Allow date validation #13

senseq opened this issue Jul 19, 2016 · 3 comments

Comments

@senseq
Copy link

senseq commented Jul 19, 2016

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

@alexweissman
Copy link
Member

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

@senseq
Copy link
Author

senseq commented Jul 20, 2016

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 [email protected]
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
.

@alexweissman
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants