Skip to content

Support DateOnly and TimeOnly as parsing options for [SupplyParameterFromQuery] #35525

Closed
@dannyBies

Description

@dannyBies

Is your feature request related to a problem? Please describe.

I want to use the DateOnly or TimeOnly types to parse querystring parameters but when I try to use either of those types I get:
NotSupportedException: Querystring values cannot be parsed as type 'System.DateOnly'..
Seeing as DateTime is supported it would be great if we can add these types as well.

Describe the solution you'd like

Support for the following code:

[Parameter, SupplyParameterFromQuery]
public DateOnly CurrentDate { get; set; }
[Parameter, SupplyParameterFromQuery]
public TimeOnly CurrentTime { get; set; }

I'd be happy to submit a PR if we want to support these scenarios.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the future

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions