private function formatTimeDiff(DateTimeInterface $date1, DateTimeInterface $date2 = null)
    {
        $isNow = $date2 === null;
        if ($isNow) {
            $date2 = new DateTime('now', $date1->getTimezone());
        }
        $interval = $date1->diff($date2);

        $translator = $this->translator();

        switch (true) {
            case ($interval->y > 0):
                $unit  = 'time.year';
                $count = $interval->y;
                break;
            case ($interval->m > 0):
                $unit  = 'time.month';
                $count = $interval->m;
                break;
            case ($interval->d > 0):
                $unit  = 'time.day';
                $count = $interval->d;
                if ($count >= 7) {
                    $unit  = 'time.week';
                    $count = (int)($count / 7);
                }
                break;
            case ($interval->h > 0):
                $unit  = 'time.hour';
                $count = $interval->h;
                break;
            case ($interval->i > 0):
                $unit  = 'time.minute';
                $count = $interval->i;
                break;
            default:
                $count = $interval->s;
                $unit  = 'time.second';
                break;
        }

        $time = $translator->transChoice($unit, $count, [ '{{ count }}' => $count ]);

        return $time;
    }