Skip to content

Commit

Permalink
Merge pull request #650 from eJJonatah/develop
Browse files Browse the repository at this point in the history
fix-date1904Attribute bool parsing possibility appointed on issue #649
  • Loading branch information
appel1 committed Jun 3, 2024
2 parents cff3ecd + f019485 commit 25e896d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override IEnumerable<Record> ReadOverride()
if (Reader.IsStartElement(ElementWorkbookProperties, ProperNamespaces.NsSpreadsheetMl))
{
// Workbook VBA CodeName: reader.GetAttribute("codeName");
bool date1904 = Reader.GetAttribute("date1904") == "1";
bool date1904 = Reader.GetAttribute("date1904") is "1" or "true";
yield return new WorkbookPrRecord(date1904);
Reader.Skip();
}
Expand Down
8 changes: 8 additions & 0 deletions test/ExcelDataReader.Tests/ExcelOpenXmlReaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ public void GitIssue425()
Assert.That(dataSet.Tables[0].Rows[2].ItemArray[0], Is.EqualTo("text text"));
}

[Test]
public void GitIssue649()
{
using var reader = OpenReader("Test_git_issue_649_Date1904_Parsings");
var dataSet = reader.AsDataSet();
Assert.That(dataSet.Tables[0].Rows[11].ItemArray[12], Is.EqualTo(new DateTime(2023, 9, 1)));
}

[Test]
public void GitIssue518MultipleHeaderRows()
{
Expand Down
Binary file not shown.

0 comments on commit 25e896d

Please sign in to comment.