mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-25 19:17:13 +08:00
Allow custom date format when displaying published state
Wen overriding the Parts.Common.Metadata.cshtml in a theme, this will allow for changing the date format used to display the date.
This commit is contained in:
committed by
Sebastien Ros
parent
6c6d2972fe
commit
0082d55914
@@ -23,12 +23,12 @@ namespace Orchard.Core.Common {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Shape]
|
[Shape]
|
||||||
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
|
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc, LocalizedString customDateFormat) {
|
||||||
if (!publisheddateTimeUtc.HasValue) {
|
if (!publisheddateTimeUtc.HasValue) {
|
||||||
return T("Draft");
|
return T("Draft");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Display.DateTime(DateTimeUtc: createdDateTimeUtc);
|
return Display.DateTime(DateTimeUtc: createdDateTimeUtc, CustomFormat: customDateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Shape]
|
[Shape]
|
||||||
|
|||||||
Reference in New Issue
Block a user