Skip to content

Anchor strict OOXML time-only cells to Excel base date - #762

Open
SparkUiX wants to merge 1 commit into
ExcelDataReader:developfrom
SparkUiX:codex/fix-strict-ooxml-time-default-date
Open

SparkUiX wants to merge 1 commit into
ExcelDataReader:developfrom
SparkUiX:codex/fix-strict-ooxml-time-default-date

Conversation

@SparkUiX

Copy link
Copy Markdown

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

  • Before the fix, the strict LocaleTime sample returned the machine's current date for a time-only cell; the new 1904 regression case also failed before the fix.
  • After the fix, the 1900 and 1904 regression cases pass, and an explicit year-1 date remains unchanged.
  • I ran the .NET 10 strict reader and related locale test filter: 95 passed, 0 failed. git diff --check passed.

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.

Copilot AI lite review requested due to automatic review settings September 25, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants