Limitations of TimeSpan DataType in Blazor TimePicker Component

29 Jul 20211 minute to read

Based on C# standard behaviour, the custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, “hh\:mm\:ss” defines a colon (:) as a separator between hours, minutes, and seconds.

@using Syncfusion.Blazor.Calendars

<SfTimePicker TValue="TimeSpan" @bind-Value="myTime" Format="@("hh\\:mm\\:ss")"></SfTimePicker>

@code {
    TimeSpan myTime = new TimeSpan(12, 59, 59);
}

The output will be as follows.

TimePicker