#NEWLINE# def subtract_days( self , days ) : #NEWLINE# #INDENT# "\n        Substract the given days from delivery time's min and max. Takes the\n        unit into account.\n        " #NEWLINE# if ( self . unit == DELIVERY_TIME_UNIT_HOURS ) : #NEWLINE# #INDENT# max_new = ( self . max - ( 24 * days ) ) #NEWLINE# min_new = ( self . min - ( 24 * days ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . unit == DELIVERY_TIME_UNIT_DAYS ) : #NEWLINE# #INDENT# max_new = ( self . max - days ) #NEWLINE# min_new = ( self . min - days ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . unit == DELIVERY_TIME_UNIT_WEEKS ) : #NEWLINE# #INDENT# max_new = ( self . max - ( days / 7.0 ) ) #NEWLINE# min_new = ( self . min - ( days / 7.0 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . unit == DELIVERY_TIME_UNIT_MONTHS ) : #NEWLINE# #INDENT# max_new = ( self . max - ( days / 30.0 ) ) #NEWLINE# min_new = ( self . min - ( days / 30.0 ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( min_new < 0 ) : #NEWLINE# #INDENT# min_new = 0 #NEWLINE# #UNINDENT# if ( max_new < 0 ) : #NEWLINE# #INDENT# max_new = 0 #NEWLINE# #UNINDENT# return self . _get_instance ( min = min_new , max = max_new , unit = self . unit )