if data:
header = data [0]
data_ = []
data_.append(header)
group_hire_date_index = header.index('group_hire_date')
now = (datetime.now()+parent_datetime.timedelta(2)).strftime('%Y-%m-%d')
for index, line in enumerate(data):
if index == 0:
continue
group_hire_date = line [group_hire_date_index]
if '/Date(' in group_hire_date:
group_hire_date = group_hire_date.split('(') [1] .split(')') [0]
group_hire_date = int(group_hire_date) / 1000
group_hire_date = datetime.fromtimestamp(group_hire_date)
group_hire_date = group_hire_date.strftime('%Y-%m-%d' )
line [group_hire_date_index] = group_hire_date
if group_hire_date >= now:
data_.append(line)
if len(data_) == 1:
data=None
else:
data = data_