Fixing Controller::cleanUpFields() formatting bug introduced in [4596] (Ticket #2322)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4733 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-04-01 15:01:28 +00:00
parent 20645337f7
commit c276d65d6f

View file

@ -925,9 +925,7 @@ class Controller extends Object {
unset($this->data[$modelClass][$field['name'] . '_meridian']);
$newDate = null;
if ('datetime' == $field['type'] && $useNewDate) {
$newDate = "{$_year}-{$_month}-{$_day}:{$_hour}:{$_min}:{$_sec}";
} else if ('timestamp' == $field['type'] && $useNewDate) {
if (in_array($field['type'], array('datetime', 'timestamp')) && $useNewDate) {
$newDate = "{$_year}-{$_month}-{$_day} {$_hour}:{$_min}:{$_sec}";
} else if ('date' == $field['type'] && $useNewDate) {
$newDate = "{$_year}-{$_month}-{$_day}";