Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Tips and Tutorials
Validation valid_date example
mikepmtl
April 2014
Just to save someone else some time.
If you want to use valid_date in a model. The format of the date format must not be quoted.
Like this:
$val->add_field('publish_start_date', 'Start Date', 'valid_date[m/d/Y g:i A]');
I mistakenly kept trying like:
$val->add_field('publish_start_date', 'Start Date', 'valid_date["m/d/Y g:i A"]');
and could not for the life of me figure out why I kept getting errors!
The error it was giving me was:
The
format separator does not match
Harro
April 2014
Correct, the regex behind it splits on the square brackets, making the double quotes part of the match string.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
April 2014