src/DateRange.php
protected function offsetMonthInDate(Carbon $original_date, $offset)
    {
        $original_month = $original_date->month;

        // Calculate expected month if offset is positive.
        if ($offset >= 0 && ($original_month + $offset) <= 12) {
            $expected_month = $original_month + $offset;
        } elseif ($offset >= 0) {
            $expected_month = 0 + ($offset - (12 - $original_month));
        }

        // Calculate expected month if offset is negative.
        elseif ($offset < 0 && ($original_month + $offset) >= 1) {
            $expected_month = $original_month + $offset;
        } elseif ($offset < 0) {
            $expected_month = 12 + ($offset + $original_month);
        }

        return $expected_month;
    }
protected function offsetMonthInDate(Carbon $original_date, $offset)
    {
        $original_month = $original_date->month;

        // Calculate expected month if offset is positive.
        if ($offset >= 0 && ($original_month + $offset) <= 12) {
            $expected_month = $original_month + $offset;
        } elseif ($offset >= 0) {
            $expected_month = 0 + ($offset - (12 - $original_month));
        }

        // Calculate expected month if offset is negative.
        elseif ($offset < 0 && ($original_month + $offset) >= 1) {
            $expected_month = $original_month + $offset;
        } elseif ($offset < 0) {
            $expected_month = 12 + ($offset + $original_month);
        }

        return $expected_month;
    }
protected function offsetMonthInDate ( Carbon $ original_date , $ offset ) { $ original_month = $ original_date -> month ; // Calculate expected month if offset is positive. if ( $ offset >= 0 && ( $ original_month + $ offset ) <= 12 ) { $ expected_month = $ original_month + $ offset ; } elseif ( $ offset >= 0 ) { $ expected_month = 0 + ( $ offset - ( 12 - $ original_month ) ) ; } // Calculate expected month if offset is negative. elseif ( $ offset < 0 && ( $ original_month + $ offset ) >= 1 ) { $ expected_month = $ original_month + $ offset ; } elseif ( $ offset < 0 ) { $ expected_month = 12 + ( $ offset + $ original_month ) ; } return $ expected_month ; }
Offsets a month in a date by a set value; offsets >12 are not currently supported.

@param Carbon $original_date
@param $offset

@return bool

@TODO Add support for offsets greater then 12 for months.
Offsets a month in a date by a set value ; offsets > 12 are not currently supported .