Skip to content

Expose duration presets as a JSON string parameter - #68

Merged
brYch97 merged 1 commit into
masterfrom
users/dominik.brych/durationFix
Sep 4, 2026
Merged

Expose duration presets as a JSON string parameter#68
brYch97 merged 1 commit into
masterfrom
users/dominik.brych/durationFix

Conversation

@brYch97

@brYch97 brYch97 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Aligns the duration presets with the other input parameters of the Duration control.

  • IDuration.durationOptions?: number[] (a component prop) is replaced by IDurationParameters.DurationOptions?: IStringProperty — PascalCase like HoursPerDay, and a JSON string like DateTime's RestrictedDates / RestrictedDaysOfWeek.
  • The control parses the raw string inside the options useMemo; when the raw value is empty it falls back to DEFAULT_DURATION_OPTIONS. An empty array offers no presets, free input still works.

Usage changes from durationOptions={[15, 30, 60]} to parameters.DurationOptions = { raw: '[15, 30, 60]' }.

Aligns the duration presets with the other input parameters: instead of a
`durationOptions: number[]` prop, the control takes a `DurationOptions`
string parameter holding a JSON array of minutes and parses it, the same
way DateTime handles RestrictedDates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@brYch97
brYch97 requested a review from a team September 4, 2026 14:30
@brYch97
brYch97 merged commit 60b37b1 into master Sep 4, 2026
1 check passed
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