|
|
|
@ -6,6 +6,7 @@ use App\Models\Activity;
|
|
|
|
|
use App\Models\Project; |
|
|
|
|
use App\Models\VersionGantt; |
|
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
|
use Illuminate\Support\Facades\Log; |
|
|
|
|
|
|
|
|
|
class MasterFunctionsHelper { |
|
|
|
|
|
|
|
|
@ -102,7 +103,8 @@ class MasterFunctionsHelper {
|
|
|
|
|
$begin = new \DateTime($minDate.' Monday'); |
|
|
|
|
if(isset($dataPayload['end_date'])){ |
|
|
|
|
$maxDate = $dataPayload['end_date']; |
|
|
|
|
$end = new \DateTime($maxDate); |
|
|
|
|
$end = new \DateTime($maxDate. ' Friday'); |
|
|
|
|
$end->modify('next Friday'); |
|
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */ // should be using this but its bugged |
|
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
|
} else { |
|
|
|
@ -112,6 +114,7 @@ class MasterFunctionsHelper {
|
|
|
|
|
->where('a.version_gantt_id', '=', $keyGantt['id']) |
|
|
|
|
->max("plan_date"); // plan date overlapped with assign_material_to_activity's, it should be m_activity's |
|
|
|
|
$end = new \DateTime($maxDate. ' Friday'); |
|
|
|
|
$end->modify('next Friday'); |
|
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
|
} |
|
|
|
|
$period = new \DatePeriod($begin, $interval, $end); |
|
|
|
|