public function getDateIntervalPropertyByUnit(DateInterval $diff, $unit)
    {
        if ($unit === 'seconds') {
            return $diff->s + $diff->i * 60 + $diff->h * 60 * 60 + $diff->days * 60 * 60 * 24;
        }

        if ($unit === 'minutes') {
            return $diff->i + $diff->h * 60 + $diff->days * 60 * 24;
        }

        if ($unit === 'hours') {
            return $diff->h + $diff->days * 24;
        }

        if ($unit === 'days') {
            return $diff->days;
        }

        if ($unit === 'months') {
            return $diff->m + $diff->y * 12;
        }

        if ($unit === 'years') {
            return $diff->y;
        }
    }