Skip to content

Commit da33265

Browse files
committed
.
1 parent 58d918e commit da33265

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed
-18 Bytes
Binary file not shown.
-18 Bytes
Binary file not shown.
-18 Bytes
Binary file not shown.
-18 Bytes
Binary file not shown.

src/Verify.ClosedXml/VerifyClosedXml.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ static ConversionResult Convert(XLWorkbook book, IReadOnlyDictionary<string, obj
6262
ShowWhiteSpace = book.ShowWhiteSpace,
6363
};
6464

65-
// force Created to a stable date so the binary will be consistent
66-
book.Properties.Created = new(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc);
65+
ForcePropsToBeStable(book);
6766

6867
var memoryStream = new MemoryStream();
6968
book.SaveAs(memoryStream);
@@ -85,6 +84,14 @@ static ConversionResult Convert(XLWorkbook book, IReadOnlyDictionary<string, obj
8584
});
8685
}
8786

87+
static DateTime stableDate = new(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc);
88+
static void ForcePropsToBeStable(XLWorkbook book)
89+
{
90+
book.Properties.Created = stableDate;
91+
book.Properties.Modified = stableDate;
92+
book.Properties.Author = null;
93+
}
94+
8895
static IEnumerable<(StringBuilder Csv, string? Name)> Convert(XLWorkbook document)
8996
{
9097
foreach (var sheet in document.Worksheets)

0 commit comments

Comments
 (0)