def day_selected(self, event):
        """
        Event for when calendar is selected, update/create date string.
        """
        date = event.GetDate()
        # WX sometimes has year == 0 temporarily when doing state changes.
        if date.IsValid() and date.GetYear() != 0:
            year = date.GetYear()
            # wx 2.8.8 has 0-indexed months.
            month = date.GetMonth() + 1
            day = date.GetDay()
            try:
                self.value = datetime.date(year, month, day)
            except __HOLE__:
                print 'Invalid date:', year, month, day
                raise
        return
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/date_editor.py/SimpleEditor.day_selected