diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 2ffa9fc3eee..aa99d09dfe6 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -587,7 +587,7 @@ function dol_get_next_week($day, $week, $month, $year) * True or 1 or 'gmt' to compare with GMT date. * Example: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, a dol_print_date on it will return 1970-01-01 00:00:00 * Example: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, a dol_print_date on it will return 1970-01-01 00:00:00 - * @return int Date for first day, '' if error + * @return int|string Date as a timestamp, '' if error */ function dol_get_first_day($year, $month = 1, $gm = false) { @@ -606,7 +606,7 @@ function dol_get_first_day($year, $month = 1, $gm = false) * @param int $month Month * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, * True or 1 or 'gmt' to compare with GMT date. - * @return int Date for first day, '' if error + * @return int|string Date as a timestamp, '' if error */ function dol_get_last_day($year, $month = 12, $gm = false) { @@ -1187,5 +1187,5 @@ function getWeekNumber($day, $month, $year) { $date = new DateTime($year.'-'.$month.'-'.$day); $week = $date->format("W"); - return $week; + return (int) $week; }