Fix duration

This commit is contained in:
Laurent Destailleur 2023-08-08 13:03:36 +02:00
parent e51e32ab7e
commit eae4dbd3c3
3 changed files with 5 additions and 3 deletions

View File

@ -219,7 +219,8 @@ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0)
* Can be used to show a duration.
*
* @param int $iSecond Number of seconds
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30",
* @param string $format Output format
* - 'all': total delay days hour:min like "2 days 12:30",
* - 'allwithouthour': total delay days without hour part like "2 days",
* - 'allhourmin': total delay with format hours:min like "60:30",
* - 'allhourminsec': total delay with format hours:min:sec like "60:30:10",

View File

@ -649,8 +649,8 @@ if ($num > 0) {
// Duration
print '<td class="center" title="'.dol_escape_htmltag($datefromto).'">';
if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
print convertSecondToTime(max($datelastresult - $datelastrun, 1), 'all');
//print '<br>'.($datelastresult - $datelastrun).' '.$langs->trans("seconds");
$nbseconds = max($datelastresult - $datelastrun, 1);
print $nbseconds.' '.($nbseconds > 1 ? $langs->trans("SecondShort") : $langs->trans("SecondShort"));
}
print '</td>';

View File

@ -346,6 +346,7 @@ MonthOfDay=Month of the day
DaysOfWeek=Days of week
HourShort=H
MinuteShort=mn
SecondShort=sec
Rate=Rate
CurrencyRate=Currency conversion rate
UseLocalTax=Include tax