mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#17825: Showing created instead of published datetime.
--HG-- branch : 1.x
This commit is contained in:
@@ -23,8 +23,12 @@ namespace Orchard.Core.Common {
|
||||
}
|
||||
|
||||
[Shape]
|
||||
public IHtmlString PublishedState(HtmlHelper Html, DateTime? dateTimeUtc) {
|
||||
return Html.DateTime(dateTimeUtc, T("Draft"));
|
||||
public IHtmlString PublishedState(HtmlHelper html, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) {
|
||||
if (!publisheddateTimeUtc.HasValue) {
|
||||
return T("Draft");
|
||||
}
|
||||
|
||||
return html.DateTime(createdDateTimeUtc);
|
||||
}
|
||||
|
||||
[Shape]
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
<div class="published">@Display.PublishedState(createdDateTimeUtc: Model.ContentPart.CreatedUtc, publisheddateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
@@ -1 +1 @@
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
<div class="published">@Display.PublishedState(createdDateTimeUtc: Model.ContentPart.CreatedUtc, publisheddateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
Reference in New Issue
Block a user