Skip to content

docs(design): plan typed dates and times - #975

Merged
andiwand merged 1 commit into
mainfrom
docs/plan-typed-dates
Oct 4, 2026
Merged

andiwand merged 1 commit into
mainfrom
docs/plan-typed-dates

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

The plan for "a typed date or time in the editor" from the open-work list of docs/design/spreadsheet-editing.md, as decisions 17 to 19. The stack that follows:

  1. A date or time value states its serial, and the op carries one.
  2. The ods writer writes a date and a time.
  3. The xlsx writer writes them, and gives the cell a date format.
  4. The sheet editor reads a typed date or time, and opens a date cell on it.

The decisions

  • 17. A date is a serial counted from 1899-12-30.
    • What the files store:
      • ods stores an ISO date in office:date-value, counted from table:null-date.
      • xlsx stores a serial, in the 1900 or the 1904 system. The 1900 system counts 1900-02-29, a day that never existed.
    • CellValue gives every date and time as days since 1899-12-30, whatever the file counts from, so a host computes a date once.
    • The op is {"type": "date", "number": …, "text": …}, and "time" the same.
  • 18. A written date keeps the format the cell has, or gets one.
    • ods writes office:date-value or office:time-value, with the text from the cell's date style if it has one.
    • xlsx writes the serial in the workbook's epoch, and gives a cell without a date format the built-in 14, 20, 21 or 22, as Excel does.
  • 19. The editor reads a date in the locale's order.
    • ISO dates always read as dates. Otherwise the order of day, month and year and the separator come from Intl.DateTimeFormat.
    • Two-digit years follow Excel's rule: below 30 is 20xx, else 19xx. Times may have AM/PM.
    • A date cell states its serial in data-odr-value, so an unchanged commit writes nothing.

Month and day names stay English in what C++ formats, because no locale data ships. That remains an open item.

A date or time value states its serial counted from 1899-12-30, whatever the
file counts from. The ods writer writes `office:date-value` and
`office:time-value`; the xlsx writer writes the serial and gives the cell a
date format. The editor reads a typed date in the locale's order and opens
a date cell on its serial.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011qFgpigFCwbfZ24TFj7eqA
@andiwand
andiwand force-pushed the docs/plan-typed-dates branch from 1080914 to ddb7392 Compare October 4, 2026 10:56
@andiwand
andiwand merged commit ed4970e into main Oct 4, 2026
23 checks passed
@andiwand
andiwand deleted the docs/plan-typed-dates branch October 4, 2026 11:02
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