Hi RedDevil, thanks for the reply
I have this code, but I think it's a bit muddled with the units being used . . could you take a look and see if this makes sense???
PHP Code:
if(date('Hi', $calc) > 1730) {
// find out how much work will be done until 1730
$first_hours = 1730 - date('Hi', $start_str);
// find out the remaining duration
$next_hours = $duration - $first_hours;
// calculate the due time, starting from 9:00AM / 28800 (Unix)
$next_time = date('H:i', 28800 + $next_hours);
// show the due date
$due = strtotime("next day $next_time", $start_str);
$task_due = date('Y-m-d H:i:s', $due);
}
This doesn't take into account any due_date that goes past 23:59, onto the next day (e.g. due_date = 04:30), so I need
A: get the above working,
B: apply similar logic to accommodate over-runs
C: loop through A/B until due_date is within working-hours (or is this over-kill???)
Bookmarks