Repository navigation
Show zero and negative date serials as Excel does (#219) - #239
Conversation
…219) Checked in real Excel: 0 under dd/mm/yyyy shows 00/01/1900, a negative value under a date or [h]:mm format fills the cell with #, and TEXT of a negative value under a date or time code gives #VALUE!. The app showed 31/12/1899 and 30/12/1899, dates Excel never shows. formatSerial now shows serial 0 as day 0 of January 1900, leaving partsOfSerial as it is for the date functions and the ISO text a cell keeps. A negative serial under a date or time format shows ######## in the grid and #VALUE! from TEXT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
# Conflicts: # README.en.md # README.md # src/app/opengraph-image.tsx # src/i18n/en.ts # src/i18n/th.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
Only the test counts conflicted in the two READMEs. Recounted to 2013 tests in 145 files; picture 27 retaken in both languages and the social card rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
For PO: CodeQL ( The other checks are all green on Two ways it gets covered:
If you want it on the PR before merging, say so and I'll bring in Generated by Claude Code |
|
PO review: merged at
Not this PR's, but it is the way most people will meet these values: opening an Small and pre-existing, and not filed: Generated by Claude Code |
What this changes
Closes #219. #225 did its
[h]/[m]/[s]part; this is the rest, zero and negative serials. Next in the sprint-final queue: #59, the last one.The bug: a value of 0 or below, under a date or time format, showed a date Excel never shows. 0 under
dd/mm/yyyyread31/12/1899, and a negative one read an invented day before it. The same was true of the grid and ofTEXT, since both go throughformatSerial.Checked in Microsoft Excel by the owner (desktop, 2026-10-05), so the tests pin what Excel shows rather than a guess. The
maincolumn was probed onmain's code:main0, formatdd/mm/yyyy00/01/190031/12/189900/01/1900-1, formatdd/mm/yyyy########30/12/1899########-1.5, format[h]:mm########-36:00########=TEXT(0,"dd/mm/yyyy")00/01/190031/12/189900/01/1900=TEXT(-1,"dd/mm/yyyy")#VALUE!30/12/1899#VALUE!=TEXT(-0.5,"hh:mm")#VALUE!12:00#VALUE!=TEXT(-1,"[h]:mm")#VALUE!-24:00#VALUE!The fix:
formatSerialshows serial 0 as day 0 of January 1900. Only the display changes.partsOfSerialstill answers 31 December 1899, because the date functions and the ISO text a cell keeps (isoFromSerial) have no day 0 to write;1900-01-00would not read back.showableAsDate). In the grid,formatNumberForDisplayshows########for it, as Excel fills the cell at its default width.TEXTgives#VALUE!.TEXT(-1,"0.0")is still-1.0.How it was verified
npm run verify(all ten gates): all ten gates green onc74f296. The current headb4566f9carries that tree unchanged; it only adds the merge ofmain03b2ac2(Refuse a sort whose range reaches a live block (#235) #238).excelDate.test.ts(+2):00/01/1900in the grid;-1underdd/mm/yyyyand-1.5under[h]:mmas########.functions.test.ts(+1):TEXTcases from the owner's check;excelDate.ts,cellFormat.tsandfunctions.ts, all three new tests fail.partsOfSerial(0)was taken out, because Excel'sDAY(0)was not checked.excelDate.test.tsrow (17 → 19).For PO
DAY(0),MONTH(0)andYEAR(0)give 31, 12, 1899. What Microsoft Excel gives for them has not been checked. This PR keeps it out of scope, so nothing changes there. It would be a small ticket of its own after the pause.########is fixed at eight characters, the width Excel shows at its default column width. Excel fills whatever width the column has; the grid shows the same eight in a wider column.The branch
Head:
claude/new-session-m6mehm-219, a second branch the owner allowed so #219 and #59 could be open together. It was opened stacked on PR #238; now that #238 is inmain, its base ismain. The PR for #59 is stacked on this one and merges after it.🤖 Generated with Claude Code
https://claude.ai/code/session_013pmWZsbmugfpqtYazrzfjj