Skip to content

馃搮 fix: Render Dotted Date Formats in Parsed Spreadsheets - #79

Closed
sindriii wants to merge 2 commits into
apro-deployfrom
apro-deploy-xlsx-dates
Closed

sindriii wants to merge 2 commits into
apro-deployfrom
apro-deploy-xlsx-dates

Conversation

@sindriii

@sindriii sindriii commented Sep 23, 2026 •

Copy link
Copy Markdown

Brings #78 onto apro-deploy as a single commit (cherry-pick of e82d21d, applied cleanly on 3fa1ecc) so the Fastland LibreChat image can be built from it. See #78 for the change and testing.

Second commit (dd89e86) fixes two review findings on top of it:

  • Quote-aware dot regex. The original rewrite quoted every . in the number format, including dots inside "..." literals and after a backslash escape, so a format like d. mmmm yyyy "kl." hh:mm still threw and stayed a serial. Quoted runs and escaped characters are now skipped.
  • Preview path. excelSheetToHtml reads the workbook on its own path and never ran the date fill, so the file preview showed a serial where the chat text showed a date. The helper now lives in spreadsheetDates.ts as a workbook-level function and is called from both excelSheetToText and excelSheetToHtml.

The fixture gained a quoted-literal format, a backslash-escaped format and a fractional-seconds format, and html.spec.ts covers the preview path. crud.spec.ts and html.spec.ts pass (136/136); prettier clean.

The repo only allows squash merges, so this lands as one commit on apro-deploy.

馃 Generated with Claude Code

SheetJS 0.20.3 treats `.` in a number format as fractional seconds, so
formatting a date cell with `dd.mm.yyyy`, `d.m.yyyy` or `dd.mm` throws and
the cell keeps only its raw value. `sheet_to_csv` then prints the Excel
serial (`46265` instead of `31.08.2026`), and the model has to convert
every date by hand. Dotted date formats are the default in many European
locales, including Icelandic bank exports.

Read the workbook with `cellNF` so number formats stay on the cells, and
for number cells that have a date format but no formatted text, render
them again with the dots quoted as literals, honouring the workbook's 1904
date system. Every other cell is left as SheetJS formatted it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

鈿欙笍 Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 79e83374-0290-4d88-bc23-4fc89aaf8aff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 馃攳 Trigger review

Comment @coderabbitai help to get the list of available commands.

The dot-quoting regex rewrote every `.` in the number format, including
dots inside `"..."` literals and after a backslash escape. A format such as
`d. mmmm yyyy "kl." hh:mm` became unbalanced, SheetJS still threw, and the
cell stayed a serial. Skip quoted runs and escaped characters so only bare
separator dots are quoted.

The rich spreadsheet preview reads the workbook on its own path and never
ran the date fill, so the same cell showed a serial in the preview and a
date in the chat text. Move the helper to `spreadsheetDates.ts` as a
workbook-level function and call it from both `excelSheetToText` and
`excelSheetToHtml`.

Extend the fixture with a quoted-literal format, a backslash-escaped format
and a fractional-seconds format, and cover the preview path in html.spec.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sindriii

Copy link
Copy Markdown
Author

Superseded: the upstream PR LibreChat-AI#16442 commit is cherry-picked onto apro-deploy as 8c8aeea.

@sindriii sindriii closed this Sep 28, 2026
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.

1 participant