Closed
Description
Background and Motivation
This is an extension of #34115 to support DateOnly
and TimeOnly
, given we already support DateTime
.
Proposed API
namespace Microsoft.AspNetCore.Components
{
public static class NavigationManagerExtensions
{
+ public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, DateOnly value)
+ public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, DateOnly? value)
+ public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, TimeOnly value)
+ public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, TimeOnly? value)
}
}
Usage Examples
[Parameter, SupplyParameterFromQuery]
public DateOnly OnlyTheDate { get; set; }
[Parameter, SupplyParameterFromQuery]
public TimeOnly OnlyTheTime { get; set; }
Alternative Designs
N/A, extension of existing API.
Risks
Concept count / complexity. Other than that, it's a fairly straightforward change that a user has requested already.