def shift_datetime(self, old_date, months):
        new_date = wx.DateTime()
        new_month = old_date.GetMonth() + months
        new_year = old_date.GetYear()
        if new_month < 0:
            new_month += 12
            new_year -= 1
        elif new_month > 11:
            new_month -= 12
            new_year += 1

        new_day = min(old_date.GetDay(), 28)
        new_date.Set(new_day, new_month, new_year)
        return new_date
Returns the prompt number.
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/date_editor.py/MultiCalendarCtrl.shift_datetime--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/gui/wx/ipshell_nonblocking.py/NonBlockingIPShell.get_prompt_count