Context
RecordFactory.parseRecordValue converts every non-Date value of a type: 'Date' field with new Date(value) (src/data/RecordFactory.mjs:469–470 at a4e508d25e, the 13.4.0 release commit). new Date(null) is the epoch, so a date that is absent comes back as a real-looking date. The sibling branches (Float, Int/Integer, Html, String) only run for truthy values, so they keep null.
I found this on 2026-11-08 while reading the field parser. I held it back until the 13.4 cut because the release gate said to file nothing new in Engine.
The Problem
Measured at a4e508d25e with a plain node script on the engine's unit setup. The model is {id: String, due: Date, age: Integer}:
create due:null Date(1970-01-01T00:00:00.000Z)
control: create age:null (Integer) null
create, due omitted undefined
control: create due:ISO string Date(2026-11-09T10:00:00.000Z)
set({due:null}) after a date Date(1970-01-01T00:00:00.000Z)
create due:undefined Date(1970-01-01T00:00:00.000Z)
create due:'' Date(Invalid)A record cannot hold "no date":
- Loading
{due: null} stores 1970-01-01.
- Clearing a date with
record.set({due: null}) stores 1970-01-01.
- An explicit
undefined does the same, because parseRecordValue defaults value to null.
The following is inferred from the code, not run:
- A
DateField with the default emptyValue: null writes null when cleared (src/form/field/Text.mjs:1184–1185).
- So clearing a date cell in
examples/grid/cellEditing stores 1970-01-01.
- Its renderer,
new Intl.DateTimeFormat('default').format(value) (examples/grid/cellEditing/MainContainer.mjs:142, and the table twin at examples/table/cellEditing/MainContainer.mjs:140), shows 1/1/1970.
Intl.DateTimeFormat#format(null) also formats the epoch, so those two renderers need the empty case as well.
The Architectural Reality
parseRecordValue (src/data/RecordFactory.mjs:420) runs on every field write: setRecordFields (:556) for create and set, and the per-field setter (:135).
nullable (:462–467) is the opt-out. nullable: false refuses null with a warning and keeps the old value. Without it, null is a legal value.
Store#getFilterValues restates the conversion rule for raw items (autoInitRecords: false) at src/data/Store.mjs:923. A raw Date-field value that is not a Date refuses the count as noncanonical-field, because hydration would change it. That was right while hydration turned null into 1970. Once null stays null, a raw null is canonical and should count.
- Some consumers already read "no date" as
null. The header value menus keep null as a distinct option (#19720). examples/data/pipeline/MainContainer.mjs:47 renders '' for a falsy value.
Design authority: learn/guides/datahandling/Records.md:52: "nullable (Boolean): If false, the field cannot be null." So a Date field without nullable: false may be null. Today it can't be.
The Fix
src/data/RecordFactory.mjs:469: convert only a value that is not null: if (type === 'date' && value != null && Neo.typeOf(value) !== 'Date'). null stays null, and an explicit undefined becomes null through the existing parameter default.
src/data/Store.mjs:923: a raw null in a Date field is canonical: type === 'date' && value !== null && !(value instanceof Date). A raw undefined still refuses, because hydration turns it into null.
- The two cell-editing example renderers render
'' for an empty value, as the pipeline example already does: ({value}) => value ? new Intl.DateTimeFormat('default').format(value) : ''.
test/playwright/unit/data/RecordFactory.spec.mjs: add rows for creating with null, set({due: null}) after a date, and an explicit undefined. Add controls: an ISO string still becomes a Date, an omitted field stays undefined, and nullable: false still refuses null. test/playwright/unit/data/StoreFilterValues.spec.mjs gets the raw-null counting row.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
type: 'Date' field value (parseRecordValue) |
Records.md:52 |
null / undefined → null. A Date passes through. Any other value → new Date(value), unchanged. |
nullable: false still refuses null |
none needed: the guide already says it |
the unit rows above |
Store#getFilterValues over raw items |
the same rule, restated for counting |
A raw null in a Date field counts as its own value |
Any other non-Date raw value still refuses as noncanonical-field |
— |
the counting row |
Acceptance Criteria
Out of Scope
'' and unparsable strings, which become an Invalid Date. Intl.DateTimeFormat#format throws RangeError on that. Whether '' means null, or whether a parse failure should be refused the way a maxLength violation is, is a design question. It gets a defect-note, not this fix.
- Date-only ISO strings parsing as UTC midnight. #19720 already formats that case.
Avoided Traps
- A truthy guard (
&& value) like the sibling branches. It would keep 0, a valid epoch timestamp, as a number instead of a Date.
Related
#19720 (value menus keep null distinct) · #5290 and #3338 (the sibling type branches)
Live latest-open + closed sweep: checked the latest 20 open plus a closed search (Date field null 1970, RecordFactory date, parseRecordValue, date null record), and read the Out of Scope of #19720, at 2026-11-09T14:10Z. No equivalent or prior exclusion found. Backlog band: 6 open (green).
MC sweep: "record field type Date null value turns into 1970-01-01 epoch, cleared date cell shows 1/1/1970", 6 results, no prior decision found.
Own-assignment sweep: 0 open, none overlapping. A2A sweep: the latest 30 messages, no overlapping claim.
Ownership: self-assigned. I've held this since the 13.4 gate (2026-11-08), and I'm starting now. (Body amended 14:2xZ at intake: the Store counting rule joins the Fix, because it restates the conversion for raw items.)
Origin Session ID: b73b26a6-280c-4dc2-a4d1-c1d482593aa1
Retrieval Hint: "RecordFactory parseRecordValue Date field null epoch 1970"
Context
RecordFactory.parseRecordValueconverts every non-Datevalue of atype: 'Date'field withnew Date(value)(src/data/RecordFactory.mjs:469–470ata4e508d25e, the 13.4.0 release commit).new Date(null)is the epoch, so a date that is absent comes back as a real-looking date. The sibling branches (Float,Int/Integer,Html,String) only run for truthy values, so they keepnull.I found this on 2026-11-08 while reading the field parser. I held it back until the 13.4 cut because the release gate said to file nothing new in Engine.
The Problem
Measured at
a4e508d25ewith a plain node script on the engine's unit setup. The model is{id: String, due: Date, age: Integer}:create due:null Date(1970-01-01T00:00:00.000Z) control: create age:null (Integer) null create, due omitted undefined control: create due:ISO string Date(2026-11-09T10:00:00.000Z) set({due:null}) after a date Date(1970-01-01T00:00:00.000Z) create due:undefined Date(1970-01-01T00:00:00.000Z) create due:'' Date(Invalid)A record cannot hold "no date":
{due: null}stores 1970-01-01.record.set({due: null})stores 1970-01-01.undefineddoes the same, becauseparseRecordValuedefaultsvaluetonull.The following is inferred from the code, not run:
DateFieldwith the defaultemptyValue: nullwritesnullwhen cleared (src/form/field/Text.mjs:1184–1185).examples/grid/cellEditingstores 1970-01-01.new Intl.DateTimeFormat('default').format(value)(examples/grid/cellEditing/MainContainer.mjs:142, and the table twin atexamples/table/cellEditing/MainContainer.mjs:140), shows1/1/1970.Intl.DateTimeFormat#format(null)also formats the epoch, so those two renderers need the empty case as well.The Architectural Reality
parseRecordValue(src/data/RecordFactory.mjs:420) runs on every field write:setRecordFields(:556) for create andset, and the per-field setter (:135).nullable(:462–467) is the opt-out.nullable: falserefusesnullwith a warning and keeps the old value. Without it,nullis a legal value.Store#getFilterValuesrestates the conversion rule for raw items (autoInitRecords: false) atsrc/data/Store.mjs:923. A rawDate-field value that is not aDaterefuses the count asnoncanonical-field, because hydration would change it. That was right while hydration turnednullinto 1970. Oncenullstaysnull, a rawnullis canonical and should count.null. The header value menus keepnullas a distinct option (#19720).examples/data/pipeline/MainContainer.mjs:47renders''for a falsy value.Design authority:
learn/guides/datahandling/Records.md:52: "nullable(Boolean): Iffalse, the field cannot benull." So aDatefield withoutnullable: falsemay benull. Today it can't be.The Fix
src/data/RecordFactory.mjs:469: convert only a value that is notnull:if (type === 'date' && value != null && Neo.typeOf(value) !== 'Date').nullstaysnull, and an explicitundefinedbecomesnullthrough the existing parameter default.src/data/Store.mjs:923: a rawnullin aDatefield is canonical:type === 'date' && value !== null && !(value instanceof Date). A rawundefinedstill refuses, because hydration turns it intonull.''for an empty value, as the pipeline example already does:({value}) => value ? new Intl.DateTimeFormat('default').format(value) : ''.test/playwright/unit/data/RecordFactory.spec.mjs: add rows for creating withnull,set({due: null})after a date, and an explicitundefined. Add controls: an ISO string still becomes aDate, an omitted field staysundefined, andnullable: falsestill refusesnull.test/playwright/unit/data/StoreFilterValues.spec.mjsgets the raw-nullcounting row.Contract Ledger
type: 'Date'field value (parseRecordValue)Records.md:52null/undefined→null. ADatepasses through. Any other value →new Date(value), unchanged.nullable: falsestill refusesnullStore#getFilterValuesover raw itemsnullin aDatefield counts as its own valueDateraw value still refuses asnoncanonical-fieldAcceptance Criteria
Datefield created withnull, or set tonullafter holding a date, readsnull. An explicitundefinedreadsnull.Date, an omitted field staysundefined, and anullable: falseDatefield still refusesnull.autoInitRecords: false, a rawnullin aDatefield counts as its own value instead of refusing the count. A raw date string still refuses asnoncanonical-field.RecordFactoryandStoreFilterValuesunit specs carry these rows, and the unit suite passes.Out of Scope
''and unparsable strings, which become anInvalid Date.Intl.DateTimeFormat#formatthrowsRangeErroron that. Whether''meansnull, or whether a parse failure should be refused the way amaxLengthviolation is, is a design question. It gets a defect-note, not this fix.Avoided Traps
&& value) like the sibling branches. It would keep0, a valid epoch timestamp, as a number instead of aDate.Related
#19720 (value menus keep
nulldistinct) · #5290 and #3338 (the sibling type branches)Live latest-open + closed sweep: checked the latest 20 open plus a closed search (
Date field null 1970,RecordFactory date,parseRecordValue,date null record), and read the Out of Scope of #19720, at 2026-11-09T14:10Z. No equivalent or prior exclusion found. Backlog band: 6 open (green). MC sweep: "record field type Date null value turns into 1970-01-01 epoch, cleared date cell shows 1/1/1970", 6 results, no prior decision found. Own-assignment sweep: 0 open, none overlapping. A2A sweep: the latest 30 messages, no overlapping claim.Ownership: self-assigned. I've held this since the 13.4 gate (2026-11-08), and I'm starting now. (Body amended 14:2xZ at intake: the
Storecounting rule joins the Fix, because it restates the conversion for raw items.)Origin Session ID: b73b26a6-280c-4dc2-a4d1-c1d482593aa1 Retrieval Hint: "RecordFactory parseRecordValue Date field null epoch 1970"