[MTELELIE-314]add get_birthday_from_nn

This commit is contained in:
Nicolas Selva 2022-08-04 14:00:19 +02:00
parent 11f18a755c
commit 548de06767
1 changed files with 10 additions and 0 deletions

View File

@ -72,6 +72,16 @@ def diff_dates(oldest_date, newest_date):
return str(diff)
@register.filter
def get_birthday_from_nn(numero_national):
"""
numero_national : (str) numero national peut contenir espace . et -
"""
numero_national = clean_string(numero_national)
date = numero_national[:6]
return datetime.datetime.strptime(date, "%y%m%d")
@register.filter
def is_valid_tva_number(tva_number, formatage=True):
"""