monir , majles update2
This commit is contained in:
@@ -1228,6 +1228,11 @@ def convert_persian_date(value):
|
||||
if _date != _date : # True اگر NaN باشد:
|
||||
return res, ''
|
||||
|
||||
_date = str(_date)
|
||||
if _date :
|
||||
_date = _date.replace('-', '/')
|
||||
_date = _date.replace('\\', '/').strip()
|
||||
|
||||
if _date and not is_match_persian_date_format(_date):
|
||||
return res, "error match_persian_date_format"
|
||||
|
||||
@@ -1246,10 +1251,10 @@ def repair_object_persian_date(item, key, error_list=None, id='', key2=''):
|
||||
res, error = convert_persian_date(_date)
|
||||
|
||||
if not res :
|
||||
if not error_list is None :
|
||||
error_list.append({'id':id, 'key': path_key, "value":_date, "message": error })
|
||||
del item[key]
|
||||
return item
|
||||
if error and not error_list is None :
|
||||
error_list.append({'id':id, 'key': path_key, "value":_date, "message": error })
|
||||
del item[key]
|
||||
return item
|
||||
|
||||
if res :
|
||||
item[key] = res
|
||||
|
||||
Reference in New Issue
Block a user