$array = [
['name' => 'taskname 1', 'date' => '2021-06-20 14:30:00'],
['name' => 'taskname 2', 'date' => '2021-06-21 14:30:00'],
['name' => 'taskname 3', 'date' => '2021-06-20 16:30:00'],
];
$calendar = [];
foreach ($array as $row) {
list($date, $time) = explode(" ", $row['date']);
list($year, $month, $day) = explode("-", $date);
$calendar[$year][$month][$day][] = [$row['name'] , $time];
}