mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 02:28:23 +01:00
Fix: on affiche le dlai en heure jusqu'a 72h ensuite on l'affiche en jour, on affiche une erreur si la date de fin est plus petite que la date de dbut
This commit is contained in:
@@ -3104,20 +3104,27 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0)
|
||||
\brief Fonction retournant le nombre de jour entre deux dates sans les jours f<>ri<72>s (jours ouvr<76>s)
|
||||
\param timestampStart Timestamp de d<>but
|
||||
\param timestampEnd Timestamp de fin
|
||||
\param inhour 0: sort le nombre de jour , 1: sort le nombre d'heure
|
||||
\param inhour 0: sort le nombre de jour , 1: sort le nombre d'heure (72 max)
|
||||
\param lastday On prend en compte le dernier jour, 0: non, 1:oui
|
||||
\return nbjours Nombre de jours ou d'heures
|
||||
*/
|
||||
function num_open_day($timestampStart, $timestampEnd,$inhour=0,$lastday=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($timestampStart < $timestampEnd)
|
||||
{
|
||||
$bit = 0;
|
||||
if ($lastday == 1) $bit = 1;
|
||||
$nbOpenDay = num_between_day($timestampStart, $timestampEnd, $bit) - num_public_holiday($timestampStart, $timestampEnd);
|
||||
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24;
|
||||
$nbOpenDay.= " ".$langs->trans("Days");
|
||||
if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort");
|
||||
return $nbOpenDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $langs->trans("Error");
|
||||
}
|
||||
return $nbOpenDay;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user