def delta(self):
        """
        Returns a delta based on this widget's information.
        
        :return     <datetime.timedelta>
        """
        number      = self._numberSpinner.value()
        unit        = self._unitCombo.currentText()
        direction   = self._directionCombo.currentText()
        
        # use past tense
        if direction == 'ago':
            number = -number
        
        if unit == 'year(s)':
            return datetime.timedelta(number * 365)
        elif unit == 'month(s)':
            return datetime.timedelta(number * 30)
        elif unit == 'week(s)':
            return datetime.timedelta(number * 7)
        elif unit == 'day(s)':
            return datetime.timedelta(number)
        elif unit == 'hour(s)':
            return datetime.timedelta(0, number * 3600)
        elif unit == 'minute(s)':
            return datetime.timedelta(0, number * 60)
        else:
            return datetime.timedelta(0, number)
def delta ( self ) : number = self . _numberSpinner . value ( ) unit = self . _unitCombo . currentText ( ) direction = self . _directionCombo . currentText ( ) if direction == 'ago' : number = - number if unit == 'year(s)' : return datetime . timedelta ( number * 365 ) elif unit == 'month(s)' : return datetime . timedelta ( number * 30 ) elif unit == 'week(s)' : return datetime . timedelta ( number * 7 ) elif unit == 'day(s)' : return datetime . timedelta ( number ) elif unit == 'hour(s)' : return datetime . timedelta ( 0 , number * 3600 ) elif unit == 'minute(s)' : return datetime . timedelta ( 0 , number * 60 ) else : return datetime . timedelta ( 0 , number )
Returns a delta based on this widget's information.
        
        :return     <datetime.timedelta>