Skip to content

feat: add date as an option for field types#318

Merged
RangerMauve merged 1 commit intomainfrom
feat/field-date-type
May 5, 2026
Merged

feat: add date as an option for field types#318
RangerMauve merged 1 commit intomainfrom
feat/field-date-type

Conversation

@RangerMauve
Copy link
Copy Markdown
Contributor

Closes #317

Adds date as a valid type for Fields. Do we need good/bad docs for this? Didn't see anything for other types of fields.

@RangerMauve RangerMauve requested review from ErikSin and cimigree May 5, 2026 14:32
Copy link
Copy Markdown
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does there need to be some kind of encoding/decoding validation to ensure the value is a valid ISO string?

Copy link
Copy Markdown
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm: is it unnecessary/useless to (de)serialize values as date objects? My initial thought is that it doesn't make sense in our case because there's an IPC boundary that potentially doesn't handle that well (e.g. I don't think rpc-reflector handles dates)

@achou11
Copy link
Copy Markdown
Member

achou11 commented May 5, 2026

Do we need good/bad docs for this? Didn't see anything for other types of fields.

It's pretty limited, but there are a couple of good doc fixtures:

{
doc: {
docId: cachedValues.docId,
versionId: cachedValues.versionId,
originalVersionId: cachedValues.originalVersionId,
schemaName: 'field',
createdAt: cachedValues.createdAt,
updatedAt: cachedValues.updatedAt,
links: [],
tagKey: 'otherTagKey',
type: 'number',
label: 'differentLabel',
appearance: 'singleline',
snakeCase: true,
universal: true,
options: [
{
label: 'someOtherLabel',
value: 'somePrimitiveTagValue',
},
],
helperText: '',
deleted: false,
},
expected: {},
},

{
doc: {
docId: cachedValues.docId,
versionId: cachedValues.versionId,
originalVersionId: cachedValues.originalVersionId,
schemaName: 'field',
createdAt: cachedValues.createdAt,
updatedAt: cachedValues.updatedAt,
links: [],
tagKey: 'myTagKey',
label: 'my label',
type: 'text',
deleted: false,
universal: false,
},
expected: {},
},

@RangerMauve
Copy link
Copy Markdown
Contributor Author

There's no existing hooks for validating values in fields (tags in an observation / track) right now so I think we can put it off until it's on our roadmap.

Just to confirm: is it unnecessary/useless to (de)serialize values as date objects?

Affirmative it is not necessary right now, we might do it later in the year but it's not on the TODO list right now.

@RangerMauve RangerMauve merged commit 83922a2 into main May 5, 2026
10 checks passed
@RangerMauve RangerMauve deleted the feat/field-date-type branch May 5, 2026 19:36
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.

Add Date as a Field Type

2 participants