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:
parent
e55c5d323f
commit
f79f98d68b
@ -188,6 +188,7 @@ Today=Today
|
||||
Yesterday=Yesterday
|
||||
Tomorrow=Tomorrow
|
||||
Quadri=Quadri
|
||||
HourShort=H
|
||||
Rate=Rate
|
||||
Bytes=Bytes
|
||||
Cut=Cut
|
||||
|
||||
@ -189,6 +189,7 @@ Today=Aujourd'hui
|
||||
Yesterday=Hier
|
||||
Tomorrow=Demain
|
||||
Quadri=Trimestre
|
||||
HourShort=H
|
||||
Rate=Taux
|
||||
Bytes=Octets
|
||||
Cut=Couper
|
||||
|
||||
@ -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és (jours ouvré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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user