@classmethod    
    def isDate(cls, value, country='nl'):
        """
        Check if value is a valid date. @@@ Still add checking on leap year
        
            >>> v = Validator()
            >>> v.isDate('2003/04/04')
            True
            >>> v.isDate('04/04/2004')
            True
            >>> v.isDate('14/04/2004')
            True
            >>> v.isDate('32-04-2004')
            False
            >>> v.isDate('14-04-2004')
            True
            >>> v.isDate('    14.04.2004')
            True
            >>> v.isDate('4-14-2004', 'usa')
            True
            >>> v.isDate('14-04-2004', 'usa')
            False
            >>> v.isDate('2000-33-44')
            False
            >>> v.isDate('2000-0202')
            False
            >>> v.isDate('2000-02-==02')
            False
            >>> v.isDate('aaa')
            False
            >>> v.isDate('2003/3')
            False
            >>> v.isDate('200-233-444')
            False
            >>> v.isDate('10-2000-12')
            False
            >>> v.isDate('10')
            False
            >>> v.isDate(10)
            False
            >>> v.isDate('')
            False
            >>> v.isDate(None)
            False
        """
        monthdays = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
        try:
            split = re.findall(cls.DATEPATTERN, value)    
        except __HOLE__:
            return False
            
        if not split:
            #print '[%s] Date has wrong format' % value
            return False

        d1 = int(split[0][0])
        d2 = int(split[0][1])
        d3 = int(split[0][2])
        if d1 >= 1000:
            # d1 is year
            if country == 'nl':        # d2 is month
                m = d2
                d = d3
            else:
                m = d3
                d = d2
        elif d3 >= 1000:
            # d3 is year
            if country == 'nl':        # d2 is month
                m = d2
                d = d1
            else:
                m = d1
                d = d2
        else:    # We don't support years < 1000
            #print '[%s] Year is out of range' % value
            return False
            
        if not (1 <= m <= 12):
            #print '[%s] Month is out of range' % value
            return False
            
        if not (1 <= d <= monthdays[m]):
            #print '[%s] Day is out of range for this month' % value
            return False

        return True
dataset/ETHPy150Open petrvanblokland/Xierpa3/xierpa3/toolbox/parsers/validator.py/Validator.isDate