ClosedXml does not allow to insert minimum datetime into cell. My datatable includes minimum datetime values that ClosedXml does not like.
using (var workbook = new XLWorkbook())
{
var dataTable = GetDataTable();
workbook.Worksheets.Add(dataTable, "myWorksheet"); // Exception thrown
workbook.SaveAs(filePath);
}
Exception is thrown when adding a worksheet: 'Unable to set cell value to 01/01/0001 00:00:00'
How could I allow ClosedXml to insert this value without throwing exception? For example it could write empty values instead of throwing exception. Would it be possible to get around this without modifying the dataTable to clean up these minimum datetime values?