Subversion Repositories SmartDukaan

Rev

Rev 10480 | Rev 11954 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10480 Rev 11953
Line 276... Line 276...
276
    if (dateToFormat=='Organisation'):
276
    if (dateToFormat=='Organisation'):
277
        return '19700101'
277
        return '19700101'
278
    return str(datetime.strptime(dateToFormat,"%b %d %Y").date()).replace('-','')
278
    return str(datetime.strptime(dateToFormat,"%b %d %Y").date()).replace('-','')
279
 
279
 
280
def getDateFormatForDob2(dateToFormat):
280
def getDateFormatForDob2(dateToFormat):
-
 
281
    try:
281
    return str(datetime.strptime(dateToFormat,"%d %b %Y").date()).replace('-','')
282
        return str(datetime.strptime(dateToFormat,"%d %b %Y").date()).replace('-','')
-
 
283
    except:
-
 
284
        return str(datetime.strptime(dateToFormat,"%d/%m/%Y").date()).replace('-','')
282
 
285
 
283
def getValidName(nameToFormat):
286
def getValidName(nameToFormat):
284
    pattern = r'[^\.a-zA-Z\ \']'
287
    pattern = r'[^\.a-zA-Z\ \']'
285
    return re.sub(pattern,"",nameToFormat)
288
    return re.sub(pattern,"",nameToFormat)
286
   
289