class Chronic::RepeaterMonth
def offset_by(time, amount, pointer)
def offset_by(time, amount, pointer) direction = pointer == :future ? 1 : -1 amount_years = direction * amount / YEAR_MONTHS amount_months = direction * amount % YEAR_MONTHS new_year = time.year + amount_years new_month = time.month + amount_months if new_month > YEAR_MONTHS new_year += 1 new_month -= YEAR_MONTHS end days = month_days(new_year, new_month) new_day = time.day > days ? days : time.day Chronic.construct(new_year, new_month, new_day, time.hour, time.min, time.sec) end