あなたが好きな何かができる:フルCalendarクラスは、ここで見つけることができ
private function generateCalendarItems()
{
//Let's build that calendar.
$date = $this->start;
$i = 0;
$separatedList = $this->separatedList();
$travelList = $this->travelsList();
$trainingUsersList = $this->trainingUsersList();
$newUserList = $this->newUserList();
while ($date <= $this->end) {
$currentDate = $date->format('Y-m-d');
$separatedArray = $this->pushToArray($separatedList, ['destroyed_date'], $currentDate);
$travelsArray = $this->pushToArray($travelList, ['leave_date', 'return_date'], $currentDate);
$trainingUsersArray = $this->pushToArray($trainingUsersList, ['due_date'], $currentDate);
$newUserArray = $this->pushToArray($newUserList, ['created_at'], $currentDate);
$trainingUsersArray = $this->groupUsersForTraining($trainingUsersArray);
if ((!empty($separatedArray) || !empty($travelsArray) || !empty($trainingUsersArray) || !empty($newUserArray)) || $currentDate == Carbon::today()->format('Y-m-d')) {
$this->calendarArray[$i]['date'] = $currentDate;
$this->calendarArray[$i]['separated'] = $separatedArray;
$this->calendarArray[$i]['travel'] = $travelsArray;
$this->calendarArray[$i]['trainingUser'] = $trainingUsersArray;
$this->calendarArray[$i]['newUser'] = $newUserArray;
}
$date->addDay();
$i++;
}
}
$this->calendarArray[$i] = array('data' => $currentDate, ...., 'newUser' => $newUserArray);
は本当に離れにそれらのキー/値のそれぞれをリストから取得できません配列を作成しますが、少なくともこれにより、$this->calendarArray
を繰り返し書き出す必要がなくなります。