Three Frontend Patterns for Date Tools That Depend on Rules

A normal date widget can add a duration and display the result. A policy-dependent date tool has a different job: it must show when the inputs are incomplete, which version of a rule was applied, and which conclusion the software cannot make.

Here are three TypeScript patterns that keep those boundaries visible.

1. Replace eligible: boolean with a state union

A Boolean makes every incomplete case look like a negative decision. Use a discriminated union instead: