mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Remove unused code and remove strict type checks.
Remove some unused code around manipulating hours. Also allow the timeFormat option to be specified as either a string or an int. Both types should be accepted and treated as equivalent.
This commit is contained in:
parent
37532389d6
commit
2f79996140
1 changed files with 3 additions and 6 deletions
|
@ -2383,9 +2383,6 @@ class FormHelper extends AppHelper {
|
|||
$current->setDate($year, $month, $day);
|
||||
}
|
||||
if ($hour !== null) {
|
||||
if ($timeFormat === '12') {
|
||||
$hour = date('H', strtotime("$hour:$min $meridian"));
|
||||
}
|
||||
$current->setTime($hour, $min);
|
||||
}
|
||||
$change = (round($min * (1 / $interval)) * $interval) - $min;
|
||||
|
@ -2511,14 +2508,14 @@ class FormHelper extends AppHelper {
|
|||
if (!empty($timeFormat)) {
|
||||
$time = explode(':', $days[1]);
|
||||
|
||||
if ($time[0] >= '12' && $timeFormat === '12') {
|
||||
if ($time[0] >= 12 && $timeFormat == 12) {
|
||||
$meridian = 'pm';
|
||||
} elseif ($time[0] === '00' && $timeFormat === '12') {
|
||||
} elseif ($time[0] === '00' && $timeFormat == 12) {
|
||||
$time[0] = 12;
|
||||
} elseif ($time[0] >= 12) {
|
||||
$meridian = 'pm';
|
||||
}
|
||||
if ($time[0] == 0 && $timeFormat === '12') {
|
||||
if ($time[0] == 0 && $timeFormat == 12) {
|
||||
$time[0] = 12;
|
||||
}
|
||||
$hour = $min = null;
|
||||
|
|
Loading…
Reference in a new issue