[英]Mudblazor : Date format in mudblazor table?
In Mudblazor table, How can I format the date as "dd/MMM/yyyy"?在 Mudblazor 表中,如何将日期格式化为“dd/MMM/yyyy”?
<MudTd DataLabel="Number">@context.ProjectNumber</MudTd>
<MudTd DataLabel="Title">@context.ProjectTitle</MudTd>
*<MudTd DataLabel="Date Of RFQ">@context.DateOfRFQ"</MudTd>*
Convert it to a String and use the Strings.ToString Format overload:将其转换为 String 并使用 Strings.ToString 格式重载:
<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:如前所述,您需要先将值 DateOfRFQ 转换为 DateTime 以克服错误:
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
无法将 lambda 表达式转换为预期的委托类型,因为块中的某些返回类型不能隐式转换为委托返回类型
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.