Hi,
I have a date field in an editor form and do not want to use a datepicker because this is historical information and many of the dates are older. So I do not have the field set as a type of date. I want to be able to validate with a single digit month and day. I have this:
Field::inst( 'start_date' )
->validator( 'Validate::dateFormat', array(
'format' => 'm/d/Y',
"message" => "Please enter a date in the format m/d/y")
)
->getFormatter( 'Format::date_sql_to_format', 'm/d/Y' )
->setFormatter( 'Format::date_format_to_sql', 'm/d/Y' )
,
And have tried many different combinations for the format in the validator. But it will only validate if all digits are entered i.e.'01/01/2001'
Any ideas? Thanks in advance.