Skip to content

Add support for other date/time fields #12376

Closed
@rynowak

Description

@rynowak

We have good support in the box for doing binding correctly to <input type="date" /> fields using @bind and <InputDate>. We haven't added support for the other HTML5 date/time quantities like month.

Right now users can work around this by manually specifying the format:

<input type="datetimelocal" @bind="someDateTimeOffset" @bind:format="yyyy-MM-ddThh:mm" />

What's missing for us to have good in the box support would be to:

  • add attributes mapping the field types to formats
  • add support to <InputDate> to switch on type (right now type="date" is hardcoded)
  • add tests for both of these

We're not doing this right now because we haven't gotten many requests for it, and users can easily work around the missing support by specifying the format. If we do add support it won't be a breaking change to anyone using the workaround because a user-specified format always wins over a framework-provided default.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedaffected-mediumThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)help wantedUp for grabs. We would accept a PR to help resolve this issueseverity-majorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions