Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dannyBies opened this issue Aug 19, 2021 · 1 comment · Fixed by #35569
Closed

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

dannyBies opened this issue Aug 19, 2021 · 1 comment · Fixed by #35569
Assignees
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-builtin-components Features related to the built in components we ship or could ship in the future
Milestone

Comments

@dannyBies
Copy link
Contributor

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.

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-builtin-components Features related to the built in components we ship or could ship in the future labels Aug 19, 2021
@TanayParikh TanayParikh added the good first issue Good for newcomers. label Aug 20, 2021
@TanayParikh TanayParikh added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Aug 20, 2021
@TanayParikh TanayParikh added this to the 6.0-rc2 milestone Aug 20, 2021
@TanayParikh TanayParikh removed the good first issue Good for newcomers. label Aug 20, 2021
@TanayParikh
Copy link
Contributor

Thanks @dannyBies, this seems like a great idea, will look into it further.

@ghost ghost added the Working label Aug 20, 2021
github-actions bot pushed a commit that referenced this issue Aug 23, 2021
TanayParikh added a commit that referenced this issue Aug 24, 2021
#35569)

* Add Support for `DateOnly` & `TimeOnly` for `SupplyParameterFromQuery`

Fixes: #35525
API Proposal: #35567

* Update RoutingTest.cs

* Update RoutingTest.cs

* Fix Tests
@ghost ghost added Done This issue has been fixed and removed Working labels Aug 24, 2021
Pilchie pushed a commit that referenced this issue Aug 24, 2021
wtgodbe added a commit that referenced this issue Aug 24, 2021
* Update dependencies from https://github.com/dotnet/efcore build 20210821.6 (#35617)

Microsoft.EntityFrameworkCore.Tools , dotnet-ef , Microsoft.EntityFrameworkCore , Microsoft.EntityFrameworkCore.SqlServer , Microsoft.EntityFrameworkCore.InMemory , Microsoft.EntityFrameworkCore.Relational , Microsoft.EntityFrameworkCore.Sqlite , Microsoft.EntityFrameworkCore.Design
 From Version 6.0.0-rc.1.21420.45 -> To Version 6.0.0-rc.1.21421.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update docker container to mcr (#35630)

Co-authored-by: Brennan <[email protected]>

* [release/6.0-rc1] Update dependencies from dotnet/runtime dotnet/efcore (#35634)

[release/6.0-rc1] Update dependencies from dotnet/runtime dotnet/efcore

* [release/6.0-rc1] HTTP/3: Response drain timeout (#35492)

- backport of #35322 to release/6.0-rc1

* [release/6.0-rc1] Reliability improvement for input date E2E tests (#35616)

* Reliability improvement for input date E2E tests

* Avoid "collection was modified" error in CircuitGracefulTerminationTests

* Avoid timing issues in CanFocusDuringOnAfterRenderAsyncWithFocusInEvent

* Update src/Components/test/E2ETest/Tests/FormsTest.cs

Co-authored-by: Tanay Parikh <[email protected]>

* Remove notes from earlier

Co-authored-by: Steve Sanderson <[email protected]>
Co-authored-by: Tanay Parikh <[email protected]>

* Minimal APIs naming cleanup

* Add Support for `DateOnly` & `TimeOnly` for `SupplyParameterFromQuery`

Fixes: #35525
API Proposal: #35567

* Add FailureReasons (#35425)

* Add support for Results extension point

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Brennan <[email protected]>
Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Steve Sanderson <[email protected]>
Co-authored-by: Tanay Parikh <[email protected]>
Co-authored-by: Stephen Halter <[email protected]>
Co-authored-by: Tanay Parikh <[email protected]>
Co-authored-by: Hao Kung <[email protected]>
Co-authored-by: Safia Abdalla <[email protected]>
Co-authored-by: Doug Bunting <[email protected]>
@pranavkm pranavkm modified the milestones: 6.0-rc2, 6.0-rc1 Aug 25, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-builtin-components Features related to the built in components we ship or could ship in the future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants