Fixing style errors.

This commit is contained in:
stickler-ci 2021-09-22 16:07:36 +00:00
parent e74043d48e
commit e5cff0ede1

View File

@ -168,30 +168,28 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
} }
//Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively)
if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') {
$timeyear = dol_print_date($time, '%Y');
$timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m');
$timemonth = dol_print_date($time, '%m'); $timetotalmonths = (($timeyear * 12) + $timemonth);
$timetotalmonths = (($timeyear * 12) + $timemonth);
$monthsexpected = ($timetotalmonths + $duration_value);
$monthsexpected = ($timetotalmonths + $duration_value);
$newtime = $date->getTimestamp();
$newtime = $date->getTimestamp();
$newtimeyear = dol_print_date($newtime, '%Y');
$newtimeyear = dol_print_date($newtime, '%Y'); $newtimemonth = dol_print_date($newtime, '%m');
$newtimemonth = dol_print_date($newtime, '%m'); $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth);
$newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth);
if ($monthsexpected < $newtimetotalmonths) {
if ($monthsexpected < $newtimetotalmonths) { $newtimehours = dol_print_date($newtime, '%m');
$newtimemins = dol_print_date($newtime, '%m');
$newtimehours = dol_print_date($newtime, '%m'); $newtimesecs = dol_print_date($newtime, '%m');
$newtimemins = dol_print_date($newtime, '%m');
$newtimesecs = dol_print_date($newtime, '%m'); $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear);
$datelim -= (3600 * 24);
$datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear);
$datelim -= (3600 * 24); $date->setTimestamp($datelim);
}
$date->setTimestamp($datelim);
}
} }
return $date->getTimestamp(); return $date->getTimestamp();
} }