public function getStringByDate(DateTime $date)
    {
        $dateNow = new DateTime();

        if ($dateNow < $date) {
            return 'Future date not implemented.';
        }

        if ($date->format('Ymd') === $dateNow->format('Ymd')) {
            return $this->getTranslator()->trans('time.today');
        }

        if ($date->format('Ymd') === ((new DateTime('yesterday'))->format('Ymd'))) {
            return $this->getTranslator()->trans('time.yesterday');
        }

        $diffDays = ceil(($dateNow->getTimestamp() - $date->getTimestamp()) / 86400);

        if (7 > $diffDays) {
            return $this->getTranslator()->trans('time.days_ago', [
                '{days}' => $diffDays,
            ]);
        }

        if ($date->format('W') === (new DateTime('-1 Week'))->format('W')) {
            return $this->getTranslator()->trans('time.last_week');
        }

        if (28 > $diffDays) {
            return $this->getTranslator()->trans('time.weeks_ago', [
                '{weeks}' => floor($diffDays / 7),
            ]);
        }

        if ($date->format('Ym') === (new DateTime('-1 month'))->format('Ym')) {
            return $this->getTranslator()->trans('time.last_month');
        }

        if ($date->format('Y') === ($dateNow->format('Y') - 1)) {
            return $this->getTranslator()->trans('time.last_year');
        }

        return $this->getTranslator()->trans('time.years_ago', [
            '{years}' => $dateNow->format('Y') - $date->format('Y'),
        ]);
    }