Reputation: 11
In Mudblazor table, How can I format the date as "dd/MMM/yyyy" ?
<MudTd DataLabel="Number">@context.ProjectNumber</MudTd>
<MudTd DataLabel="Title">@context.ProjectTitle</MudTd>
*<MudTd DataLabel="Date Of RFQ">@context.DateOfRFQ"</MudTd>*
Upvotes: 1
Views: 3759
Reputation: 65692
Convert it to a String and use the Strings .ToString Format overload:
<MudTd DataLabel="Date Of RFQ">@Convert.ToDateTime(@context.DateOfRFQ).ToString("dd/MM/yyyy")</MudTd>
As noted you needed to convert the value DateOfRFQ to a DateTime first to overcome the error:
Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
Upvotes: 1