From 2ca0a1facf2e82fc76983d6613238badbb4f0b57 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 20 Oct 2021 00:36:24 +0200 Subject: [PATCH] Update date.lib.php --- htdocs/core/lib/date.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 613533a443a..ac91ea3065e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -117,7 +117,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * @param int $duration_unit Unit of added delay (d, m, y, w, h, i) * @return int New timestamp */ -function dol_time_plus_duree($time, $duration_value, $duration_unit) +function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) { global $conf; @@ -167,7 +167,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) $date->add($interval); } //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 ($ruleforendofmonth == 1 && $duration_unit == 'm') { $timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m'); $timetotalmonths = (($timeyear * 12) + $timemonth);