Thanks for sharing this sweet extra!
Here is how I run it for an internal office site where
the work day is 9 hours (including lunch) 5 days per week
= the timeout gap is then 15 hours = 900 minutes
(If I understand this correct)
[[malteStartDate]] - [[malteEndDate]]
[[MaLTE?
&timeout=`900`
&dateStart=`[[malteStartDate]]`
&dateEnd=`[[malteEndDate]]`
]]
malteStartDate
<?php
return date("Y-m-d", strtotime('-7 weekdays'));
malteEndDate
<?php
return date("Y-m-d", strtotime('+1 weekday'));
Modification 1
if ($diff >= $timeoutsec) {
// the next step is more than $timeout seconds after than the current.
// It's a new workunit. Something like yesterday - today or "before lunch"
$output .= '<div><strong>'.$thisTime.'</strong> » '.timeformat($workunit).'</div>';
$totalseconds += $workunit;
$output .= '<div>Total time: '.timeformat($totalseconds).'</div>';
$output .= '</p><p><div></div>';
$workunit = 0;
}
Modification 2
function timeformat($seconds)
{
return sprintf('%02d:%02d:%02d', $seconds / 60 / 60 / 24, ($seconds / 60 / 60) % 24, ($seconds / 60) % 60, $seconds % 60);
}
Total time: 00:14:32 between 2015-10-29 - 2015-11-10
[ed. note: mrhaw last edited this post 8 years, 5 months ago.]