Ouzo\Utilities\TimeAgo::prepare PHP Method

prepare() private method

private prepare ( ) : void
return void
    private function prepare()
    {
        $date = new DateTime($this->date);
        if ($this->showJustNow()) {
            $this->key = 'timeAgo.justNow';
            return;
        }
        if ($minutesAgo = $this->showMinutesAgo()) {
            $this->key = 'timeAgo.minAgo';
            $this->params = array('label' => $minutesAgo);
            return;
        }
        if ($this->showTodayAt()) {
            $this->key = 'timeAgo.todayAt';
            $this->params = array('label' => $date->format('H:i'));
            return;
        }
        if ($this->showYesterdayAt()) {
            $this->key = 'timeAgo.yesterdayAt';
            $this->params = array('label' => $date->format('H:i'));
            return;
        }
        if ($this->showThisYear()) {
            $this->key = 'timeAgo.thisYear';
            $this->params = array('day' => $date->format('j'), 'month' => 'timeAgo.month.' . $date->format('n'));
            return;
        }
        $this->key = $date->format('Y-m-d');
    }