Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes strict OOXML time-only cells to use the workbook’s Excel base date instead of the machine’s current date.
Changes:
- Parses values invariantly without current-date defaults.
- Supports 1900 and 1904 date systems.
- Adds regression coverage, including explicit year-1 dates.
| File | Description |
|---|---|
src/ExcelDataReader/Core/OpenXmlFormat/XlsxWorksheet.cs |
Corrects strict time-only date conversion. |
src/ExcelDataReader.Tests/ExcelOpenXmlStrictReaderTest.cs |
Adds regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Strict OOXML time-only cells currently pick up the machine's current date when parsed, so reading the same workbook on different days can produce different values. Parse those cells without a current-date default and anchor time-only values to the workbook's Excel date base. This matches the behavior of the existing transitional workbook sample and the direction discussed in #759.
The change preserves explicit dates, including
0001-01-01, and uses the existing date conversion helper for both 1900 and 1904 date systems.Addresses #759.
Verification
LocaleTimesample returned the machine's current date for a time-only cell; the new 1904 regression case also failed before the fix.git diff --checkpassed.I did not run the full test suite or the .NET Framework target. The repository's strict samples use
HH:-prefixed time-only values; other representations were not individually verified.AI assistance
This change was developed with Codex AI assistance. The diff, issue discussion, and reported test evidence were reviewed before submission.