app\models\Invoice::getPrettySchedule PHP Method

getPrettySchedule() public method

public getPrettySchedule ( integer $min = 1, integer $max = 10 ) : null
$min integer
$max integer
return null
    public function getPrettySchedule($min = 1, $max = 10)
    {
        if (!($schedule = $this->getSchedule($max))) {
            return null;
        }
        $dates = [];
        for ($i = $min; $i < min($max, count($schedule)); $i++) {
            $date = $schedule[$i];
            $dateStart = $date->getStart();
            $date = $this->account->formatDate($dateStart);
            $dueDate = $this->getDueDate($dateStart);
            if ($dueDate) {
                $date .= ' <small>(' . trans('texts.due') . ' ' . $this->account->formatDate($dueDate) . ')</small>';
            }
            $dates[] = $date;
        }
        return implode('<br/>', $dates);
    }