Datetime fields: parse every stored value into one standard, element params included #158
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Wherever the editor reads a
datetimevalue, it should parse any spelling Hugo reads and hand the form one standard, RFC3339. Every save writes RFC3339. #151 does this for page properties; element params and sidecar defaults still require exact RFC3339. The maintainer asked for one standard everywhere (in #151's triage).Current behavior
content.DateRFC3339(internal/content/meta.go) turns every date spelling Hugo reads into RFC3339. The page tree and the module entries endpoint use it, and #151 routes the page properties read through it.GET /api/page): block elements, inline elements in rich text, and item-collection rows. Adatetimeparam is plain text there. The element form checks it against exact RFC3339 on save (isRFC3339inweb/src/components/fields.tsx), and so does the server (element.ValidateValues). A hand-writtenstart="2026-07-10"therefore blocks the element's save until the date is entered again. This was found by reading the code; no shipped element has adatetimeparam.datetimeparam's or field'sdefault:is checked at load (internal/element).default: 2026-07-10is a load error ("is not a valid RFC3339 datetime"); checked in triage.datetime's "stored value, the shortcode param, and anydefault:are always the plain RFC3339 string".Desired behavior
datetimevalue hands the form RFC3339, whatever spelling Hugo reads: page-type fields (#151), element params (block elements, inline elements, item rows) and sidecar defaults.Decisions
content.DateRFC3339, as #151 settles it for front matter.element.ValidateValuesdon't change; the leniency lives in the reads.Open questions
datetimeparams in theGET /api/pagepayload, using the element schemas. That keeps one conversion, but the payload stops being a plain parse of the file.Key interfaces
content.DateRFC3339(internal/content/meta.go).GET /api/page,internal/server) and the forms that read it:FormPane(initialFieldValues,nodeParamValue), inline elements (web/src/rte/RichTextField.tsx), item rows.datetimedefault check ininternal/element(load.go); page-type fields reuse it (internal/pagetype).Out of scope
timeZonefor offset-less values.Blocked by
content.DateRFC3339and documents front-matter dates in AGENTS.md; this issue extends both)Closing as superseded. In triage the maintainer chose to define each field type once instead of fixing datetime reads place by place:
default:values in any spelling are part of it.The date spellings reproduced here are acceptance criteria in both issues.