Closed
Description
Is your feature request related to a problem? Please describe.
Date inputs have string bindings, which are rarely helpful.
Describe the solution you'd like
It should be possible to specify the type of binding:
<input type="date" bind:value|date={date_as_date}>
<input type="date" bind:value|number={date_as_number}>
<input type="date" bind:value|string={date_as_string}>
In v4, we can switch the default over to the value|date
behaviour.
Describe alternatives you've considered
Adding valueAsNumber
and valueAsDate
bindings. There are a couple of reasons not to do this:
- It would introduce an inconsistency with how
number
andrange
inputs are currently handled - Resolving that inconsistency would mean expecting people to type
valueAsNumber
instead of justvalue
. It's unergonomic - Having multiple binding options makes it easy for someone to use them all simultaneously, which could lead to subtle bugs from not having a single source of truth
How important is this feature to you?
Medium