[BUG] XLSX date-times on January 1, 1904 lose the date

Aperta
#1,877 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yorzi ci sta già lavorando.

Dal 29/11/2026.

  • #1878 di @yorzi — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
data

Direzione di ricerca

Start with RubyLLM::FileStore::Memory and run the issue’s XLSX reproduction from the repository root. Trace how xl/workbook.xml, cell number formats, and Excel serial values are handled, then confirm extraction returns "1904-01-01 12:00:00\t12:00:00"; linked PR #1878 already targets this work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Basic checks
  • I searched existing issues - this hasn't been reported
  • I can reproduce this consistently
  • This is a RubyLLM bug, not my application code
What's broken?

FileStore extracts a date-time cell containing Excel serial 0.5 as a clock time in a workbook that uses the 1904 date system. The serial represents noon on January 1, 1904 when the number format includes a date.

How to reproduce

Run this from the repo root. It needs Python 3 for the fixture. It creates a workbook with a built-in date-time cell (format 22) and a clock cell (format 21).

fixture_dir=$(mktemp -d)
trap 'rm -f "$fixture_dir/epoch.xlsx" && rmdir "$fixture_dir"' EXIT
python3 - "$fixture_dir/epoch.xlsx" <<'PY'
import sys
import zipfile

with zipfile.ZipFile(sys.argv[1], "w") as workbook:
    workbook.writestr("xl/workbook.xml", '<workbook><workbookPr date1904="1"/></workbook>')
    workbook.writestr("xl/styles.xml", '<styleSheet><cellXfs><xf numFmtId="22"/>'
                      '<xf numFmtId="21"/></cellXfs></styleSheet>')
    workbook.writestr("xl/worksheets/sheet1.xml", '<worksheet><sheetData><row>'
                      '<c r="A1" s="0"><v>0.5</v></c><c r="B1" s="1"><v>0.5</v></c>'
                      '</row></sheetData></worksheet>')
PY
bundle exec ruby -Ilib -rruby_llm -e '
  store = RubyLLM::FileStore::Memory.new
  store.write("epoch.xlsx", File.binread(ARGV.fetch(0)))
  puts store.text("epoch.xlsx").lines.last.chomp.inspect
' "$fixture_dir/epoch.xlsx"
Expected behavior

"1904-01-01 12:00:00\t12:00:00"

What actually happened

"12:00:00\t12:00:00"

Environment
  • Ruby 4.0.9 on macOS arm64
  • RubyLLM 2.2.3 on main at c0889f414
  • Local FileStore extraction without a provider
Lingua principale
Ruby
Stelle
4.5k
Fork
543
Merge medio
11h 38m
PR unite (30g)
410

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di crmne/ruby_llm

Tutte le issue di crmne/ruby_llm

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.