Skip to content

feat(TU-45701): add the time_format field property - #169

Draft
trapped wants to merge 2 commits into
mainfrom
feat/TU-45701_document_time_format_property
Draft

feat(TU-45701): add the time_format field property#169
trapped wants to merge 2 commits into
mainfrom
feat/TU-45701_document_time_format_property

Conversation

@trapped

@trapped trapped commented Aug 17, 2026

Copy link
Copy Markdown
Member

Description

The date block can now optionally collect a time of day. A field opts in by setting a new
time_format property; when the property is absent the field stays date-only. This adds that
property to Properties.Field.

  • src/typeform-types.ts: time_format?: 'HH:mm' | 'hh:mm a', added after separator. No
    Default: line in the JSDoc — absence of the property is the off state, so documenting a
    default would imply time is always collected.
  • Second commit (independent, safe to drop): structure's JSDoc claimed Default: "DDMMYYYY", but
    the block's own defaults use MMDDYYYY (blocks/src/blocks/date/default.json). Comment-only and
    unrelated to the time work.

Motivation and Context

TU-45701 — https://typeform.atlassian.net/browse/TU-45701

Without this, consumers of this client cannot set or read time_format without casting, even though
the Forms API accepts it.

Testing

  • npx rollup -c (what yarn build runs) — succeeded, so the new type compiles and type-checks.
  • npx eslint . --max-warnings=0 — exit 0.

Both were invoked directly rather than through yarn, because engines.node requires >= 24 and this
environment has Node 20. CI runs the supported version.

Backward Compatibility

No break. The property is optional and additive; no existing type changed shape.

Out of scope, left alone deliberately

The Type union (~line 1331) is missing several block types that already ship. Unrelated to this
ticket and worth its own change — flagging it rather than widening this one.

The date block can now optionally collect a time of day. A field opts in by
setting time_format; omitting the property keeps the field date-only, so there
is deliberately no documented default.
The date block defaults structure to MMDDYYYY, not DDMMYYYY. This is a comment
only, unrelated to the time work, and safe to drop from this pull request if you
would rather it went in on its own.
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