Skip to content

Commit

Permalink
apply DisplayTimeForPubDate
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Sep 27, 2023
1 parent e1d9ffe commit 986ac4f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Moonglade.Web/Pages/Post.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</text>
}
var pid = document.querySelector('article').dataset.postid;
var pid = document.querySelector('article').dataset.postid;
window.fitImageToDevicePixelRatio = @BlogConfig.ImageSettings.FitImageToDevicePixelRatio.ToString().ToLower();
Expand Down Expand Up @@ -154,7 +154,16 @@

<i class="bi-calendar-event"></i>
<span class="me-2">
<time data-utc-label="@Model.Post.PubDateUtc.GetValueOrDefault().ToString("u")">@Model.Post.PubDateUtc</time>
@if (BlogConfig.ContentSettings.DisplayTimeForPubDate)
{
<time data-utc-label="@Model.Post.PubDateUtc.GetValueOrDefault().ToString("u")">@Model.Post.PubDateUtc</time>
}
else
{
<time>
@DateOnly.FromDateTime(Model.Post.PubDateUtc.GetValueOrDefault()) (UTC)
</time>
}
</span>
</div>

Expand Down

0 comments on commit 986ac4f

Please sign in to comment.