public function get_index() { $calendar = new GoogleCalendar(); $calendarId = "*****@*****.**"; $results = $calendar->get_time_available($calendarId); foreach ($results as $timesheet) { //var_dump($timesheet); echo date("d-m-Y", strtotime($timesheet->start->dateTime)) . " - " . date("d-m-Y", strtotime($timesheet->end->dateTime)) . "<br />"; } }
private function prepareSchedule() { $users = User::all(); foreach ($users as $user) { if (!$user->is_team) { continue; } $this->schedules[$user->id] = []; $calendar = new GoogleCalendar(); $calendarId = "*****@*****.**"; $this->userGoogleTimesheets[$user->id] = $calendar->get_time_available($user->google_calendar_id); $this->addDayToSchedule($user->id); } $this->todo_list = $this->prepareTodos(); $this->setUserTasks(); }