feat(TU-45701): add the time_format field property - #169
Draft
trapped wants to merge 2 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The date block can now optionally collect a time of day. A field opts in by setting a new
time_formatproperty; when the property is absent the field stays date-only. This adds thatproperty to
Properties.Field.src/typeform-types.ts:time_format?: 'HH:mm' | 'hh:mm a', added afterseparator. NoDefault:line in the JSDoc — absence of the property is the off state, so documenting adefault would imply time is always collected.
structure's JSDoc claimedDefault: "DDMMYYYY", butthe block's own defaults use
MMDDYYYY(blocks/src/blocks/date/default.json). Comment-only andunrelated 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_formatwithout casting, even thoughthe Forms API accepts it.
Testing
npx rollup -c(whatyarn buildruns) — succeeded, so the new type compiles and type-checks.npx eslint . --max-warnings=0— exit 0.Both were invoked directly rather than through
yarn, becauseengines.noderequires >= 24 and thisenvironment 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
Typeunion (~line 1331) is missing several block types that already ship. Unrelated to thisticket and worth its own change — flagging it rather than widening this one.