Repository navigation
fix: read an ods duration of one to fifty-nine days on the day LibreOffice shows, not a day later - #193
Merged
Conversation
…ffice shows, not a day later
vaceslav
added a commit
that referenced
this pull request
Nov 18, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.3](v0.8.2...v0.8.3) (2026-11-17) ### Bug Fixes * count dates written with a multi-character date separator as the culture's own ([#186](#186)) ([fc8b11f](fc8b11f)) * count each ods sheet's repeats once against MaxRepeatedCells, so reading a sheet again is not refused ([#187](#187)) ([b450d4a](b450d4a)) * locate a workbook cell that does not fit a reading among its outliers ([#194](#194)) ([7ebcfbc](7ebcfbc)) * read an ods duration of one to fifty-nine days on the day LibreOffice shows, not a day later ([#193](#193)) ([a7145d3](a7145d3)) * read Excel's phantom 29 February 1900 as no date, a cell without a style as style 0, and character references of any length ([#189](#189)) ([e4008fa](e4008fa)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Slava <vaceslav@users.noreply.github.com>
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.
An ods time cell holds an ISO 8601 duration counted from LibreOffice's null date, 30 December 1899. LibreOffice writes a date-time as such a duration when the cell has a time-only format. The reader counted durations of one to fifty-nine days from 31 December, the base an xlsx 1900-system serial below 60 needs because Excel invents a 29 February 1900. LibreOffice's calendar has no such day, so those cells, the dates of January and February 1900, read one day later than LibreOffice shows them. Noticed while fixing serial 60 for #184.
What changes:
XlsxCursor.TryFromWorkbookDays, added in fix: read Excel's phantom 29 February 1900 as no date, a cell without a style as style 0, and character references of any length #189 for the ods path only, is gone.TryFromSerialagain picks its own base, and the 30 December date is the sharedXlsxCursor.LibreOfficeNullDate.The one visible cost: a duration just under a day reads later than one of exactly a day. No date-time of LibreOffice's falls there, and this is noted in the remarks. Before the change the same jump sat at sixty days.
Tests: a new theory pins 23:59:59, one day, 1½ days, 2, 59, 60 and 61 days.
ReadsATimeWithMoreFractionalDigitsThanATimeSpanHolds(1,234 hours, about 51 days) now expects the day LibreOffice shows.docs/formats.mddescribes the rule.