I have a date column I am trying to format with xlsxwriter.
The column can have a date in it or be blank.
The conditional formatting (highlight cell when date is < today) I am trying to apply is working. But it is also applying the same formatting rules to the blank cells.
How can I prevent it from formatting the blank cells?
See below for code:
format1 = workbook.add_format({'bg_color': '#FFC7CE',
'font_color': '#9C0006'})
date = datetime.now()
worksheet.conditional_format(due_range, {'type': 'date',
'criteria': 'less than',
'value': date,
'format': format1})
writer.save()
workbook.close()