time input: refactor to allow setting value reactively

This commit is contained in:
Elijah Duffy
2025-07-22 15:39:52 -07:00
parent 2e3de49851
commit a99384e887
2 changed files with 79 additions and 77 deletions

View File

@@ -266,7 +266,14 @@
<TimeInput label="Compact time" compact bind:value={timeValue} />
</InputGroup>
<InputGroup>
<p>Selected time is {formatTime(timeValue, 'undefined')}</p>
<p>Selected time is {formatTime(timeValue, 'undefined')} ({timeValue?.toString()})</p>
<Button
onclick={() => {
timeValue = new Time(15, 0);
}}
>
Set 3:00 PM
</Button>
</InputGroup>
</div>