James Amorado
James Amorado

Reputation: 11

Mudblazor : Date format in mudblazor table?

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>*

modified the date format

Upvotes: 1

Views: 3759

Answers (2)

Tibor
Tibor

Reputation: 36

Better to use MudDataGrid and than you can use Format="d" parameter.

Upvotes: 2

Jeremy Thompson
Jeremy Thompson

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

Related Questions