How do you apply a format string when binding a value with @bind (for example a date)?
Last updated
Add
@bind:format="yyyy-MM-dd"alongside@bind. The .NET format string is used both to display the value and to parse typed input back.It works only for types that round-trip format strings (notably
DateTime/DateTimeOffset). For a native date picker,<input type="date">expectsyyyy-MM-dd.