Skip to content

Commit

Permalink
adjust date function format param
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosurita committed Jan 17, 2024
1 parent 8dd2e31 commit a5e0686
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2645,10 +2645,10 @@ public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $a
if (!empty($interval) && $interval > 1 && !empty($min)) {
$current = new DateTime();
if ($year !== null) {
$current->setDate((int)$year, (int)$month, (int)$day);
$current->setDate($year, $month, $day);
}
if ($hour !== null) {
$current->setTime((int)$hour, (int)$min);
$current->setTime($hour, $min);
}
$changeValue = $min * (1 / $interval);
switch ($round) {
Expand Down Expand Up @@ -2778,7 +2778,7 @@ protected function _getDateTimeValue($value, $timeFormat) {
$value
);
} catch (\Error) {
$value = date('yyyy-MM-dd HH:mm:SS', $value);
$value = date('Y-m-d H:i:s', $value);
}
}
$meridian = 'am';
Expand Down Expand Up @@ -3044,7 +3044,7 @@ protected function _generateOptions($name, $options = array()) {
mktime(1, 1, 1, $m, 1, 1999)
);
} catch (\Error) {
$data[sprintf("%02s", $m)] = date('MM', mktime(1, 1, 1, $m, 1, 1999));
$data[sprintf("%02s", $m)] = date('m', mktime(1, 1, 1, $m, 1, 1999));
}
}
}
Expand Down

0 comments on commit a5e0686

Please sign in to comment.