-
Notifications
You must be signed in to change notification settings - Fork 302
Open
Labels
bugSomething isn't workingSomething isn't working
Description
EPPlus usage
Commercial use (I have a commercial license)
Environment
OSX
Epplus version
8.4.0
Spreadsheet application
excel
Description
If I open a date formatted like this in excel, it renders. but in EPPlus it throws an error.
public void EPPlus_ThrowsFormatException_ForMalformedDateFormat()
{
using var pkg = new ExcelPackage();
var ws = pkg.Workbook.Worksheets.Add("Test");
ws.Cells["A1"].Value = new DateTime(2024, 12, 31);
ws.Cells["A1"].Style.Numberformat.Format = "[$-en-US]mmm d, 'yy;@";
// Directly accessing cell.Text should throw FormatException
// This documents the bug that our workaround addresses
var ex = Assert.Throws<FormatException>(() => ws.Cells["A1"].Text);
Assert.Contains("quote", ex.Message, StringComparison.OrdinalIgnoreCase);
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog