Skip to content

Commit

Permalink
#283 284 [Lib] fix: condition not always checked for first day of wee…
Browse files Browse the repository at this point in the history
…k/month
  • Loading branch information
evarisk-micka committed Jun 16, 2023
1 parent 5da75fc commit 0547ea8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/dolisirh_function.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1829,16 +1829,14 @@ function getTaskProgressColorClass($progress)
*/
function dolisirh_num_between_day($timestampStart, $timestampEnd, $lastDay = 0)
{
if ($timestampStart < $timestampEnd) {
if ($timestampStart <= $timestampEnd) {
if ($lastDay == 1) {
$bit = 0;
} else {
$bit = 1;
}
$daysNumber = (int) round(($timestampEnd - $timestampStart) / (60 * 60 * 24)) + 1 - $bit;
}
if (empty($daysNumber)) {
$daysNumber = 1;
}

return $daysNumber;
}

0 comments on commit 0547ea8

Please sign in to comment.