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:
Peter Davis
2016-09-23 05:30:15 +09:30
committed by Sebastien Ros
parent 6c6d2972fe
commit 0082d55914

View File

@@ -23,12 +23,12 @@ namespace Orchard.Core.Common {
}
[Shape]
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc, LocalizedString customDateFormat) {
if (!publisheddateTimeUtc.HasValue) {
return T("Draft");
}
return Display.DateTime(DateTimeUtc: createdDateTimeUtc);
return Display.DateTime(DateTimeUtc: createdDateTimeUtc, CustomFormat: customDateFormat);
}
[Shape]