protected function getStartAndEndDate($date)
    {
        $year = $month = $day = null;

        //Sets the start date
        if (in_array($date, ['today', 'yesterday'])) {
            $start = Time::parse($date);
        } else {
            list($year, $month, $day) = array_replace([null, null, null], explode('/', $date));
            $start = Time::now()->setDate($year, $month ?: 1, $day ?: 1);
        }

        $start = $start->setTime(0, 0, 0);
        $end = Time::parse($start);

        if (($year && $month && $day) || in_array($date, ['today', 'yesterday'])) {
            $end = $end->addDay(1);
        } else {
            $end = $year && $month ? $end->addMonth(1) : $end->addYear(1);
        }

        return [$start, $end];
    }