How can I get the built-in date formatting working in my Cake app? Maybe I am making some simple mistake. I'm focused on the model code right now, I think this is what I am screwing up.
On the page it looks like it's working, showing three select widgets with months, days, years in that order. However, when I submit the form I'm getting the "Must be a valid date" message.
Here's the view code I have:
echo $this->Form->create('Subscription');
echo $this->Form->input('starts',array('type'=>'date','dateFormat'=>'MDY'));
echo $this->Form->end('Submit', true);
And in my model the validation looks like this:
'starts' => array(
'date' => array(
'rule' => array('date', array('MDY')),
'message' => 'Must be a valid date',
),
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Start date is required',
),
),
The field I'm trying to update is declared as DATETIME in the mysql db, in case that makes a difference.