'Increments the designated field and resets all less significant fields to their minimum values.
:type dateval: datetime
:type fieldnum: int
:return: a tuple containing the new date, and the number of the field that was actually incremented
:rtype: tuple'

def _increment_field_value(self, dateval, fieldnum):

    values = {}
    i = 0
    while (i < len(self.fields)):
        field = self.fields[i]
        if (not field.REAL):
            if (i == fieldnum):
                fieldnum -= 1
                i -= 1
            else:
                i += 1
            continue
        if (i < fieldnum):
            values[field.name] = field.get_value(dateval)
            i += 1
        elif (i > fieldnum):
            values[field.name] = field.get_min(dateval)
            i += 1
        else:
            value = field.get_value(dateval)
            maxval = field.get_max(dateval)
            if (value == maxval):
                fieldnum -= 1
                i -= 1
            else:
                values[field.name] = (value + 1)
                i += 1
    difference = (datetime(**values) - dateval.replace(tzinfo=None))
    return (self.timezone.normalize((dateval + difference)), fieldnum)
