TimeOnly Support in Blazor TimePicker Component
7 Aug 20261 minute to read
The TimeOnly type is a new type in .NET 6 that allows you to represent a time without a date component. To use it with the Blazor TimePicker component, set the type parameter to TimeOnly.
Blazor TimePicker Component supports
TimeOnlytype in .NET 7 and above version only, even though it was introduced in .NET 6 itself due to a serialization problem in .NET 6.
@using Syncfusion.Blazor.Calendars
<p>Time : @Value</p>
<SfTimePicker TValue="TimeOnly" @bind-Value="@Value" ></SfTimePicker>
@code
{
public TimeOnly Value { get; set; } = new TimeOnly(12, 00, 00);
}