mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 09:34:33 -04:00
Merge pull request #4405 from beganovich/v5-support-for-sameday-tasks
(v5) Group tasks' date if they were on the same date
This commit is contained in:
commit
052b76a895
@ -14,6 +14,7 @@ namespace App\Services\PdfMaker\Designs\Utilities;
|
|||||||
|
|
||||||
use App\Models\Task;
|
use App\Models\Task;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Carbon\Carbon;
|
||||||
use DOMDocument;
|
use DOMDocument;
|
||||||
use DOMXPath;
|
use DOMXPath;
|
||||||
use Exception;
|
use Exception;
|
||||||
@ -249,11 +250,18 @@ trait DesignHelpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($_logs as $log) {
|
foreach ($_logs as $log) {
|
||||||
$logs[] = sprintf(
|
$start = Carbon::createFromTimestamp($log[0]);
|
||||||
'%s - %s',
|
$finish = Carbon::createFromTimestamp($log[1]);
|
||||||
\Carbon\Carbon::createFromTimestamp($log[0])->format($this->entity->client->date_format() . ' h:i:s'),
|
|
||||||
\Carbon\Carbon::createFromTimestamp($log[1])->format($this->entity->client->date_format() . ' h:i:s')
|
if ($start->isSameDay($finish)) {
|
||||||
);
|
$logs[] = sprintf('%s: %s - %s', $start->format($this->entity->client->date_format()), $start->format('h:i:s'), $finish->format('h:i:s'));
|
||||||
|
} else {
|
||||||
|
$logs[] = sprintf(
|
||||||
|
'%s - %s',
|
||||||
|
$start->format($this->entity->client->date_format() . ' h:i:s'),
|
||||||
|
$finish->format($this->entity->client->date_format() . ' h:i:s')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $logs;
|
return $logs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user