Browse Source

Merge pull request 'update import' (#66) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#66
pull/3/head
ibnu 2 years ago
parent
commit
f65bf26fee
  1. 7
      app/Http/Controllers/ActivityController.php

7
app/Http/Controllers/ActivityController.php

@ -396,9 +396,12 @@ class ActivityController extends Controller
}
};
}
$projectStart = Project::select('mulai_proyek')->where('id', $projectId)->first();
foreach ($data['activities'] as $i => $activity_row) {
$startDate = \DateTime::createFromFormat('d-m-y', $activity_row['start_date']);
$endDate = \DateTime::createFromFormat('d-m-y H:i:sO', $activity_row['end_date']);
$startDate = \DateTime::createFromFormat('Y-m-d H:i:s.uP', $projectStart->mulai_proyek);
$endDate = clone $startDate;
$endDate->modify('+'.$activity_row['duration'].' days');
$endDate->setTime(23, 59, 59);
$input['name'] = $activity_row['name'];
$input['proyek_id'] = $projectId;
$input['version_gantt_id'] = $data['ganttId'];

Loading…
Cancel
Save