diff --git a/src/Moonglade.Web/Pages/Post.cshtml b/src/Moonglade.Web/Pages/Post.cshtml index 870b4a6e3..15fcef372 100644 --- a/src/Moonglade.Web/Pages/Post.cshtml +++ b/src/Moonglade.Web/Pages/Post.cshtml @@ -208,13 +208,11 @@ @if (BlogConfig.ContentSettings.EnableComments) { - if (BlogConfig.ContentSettings.CloseCommentAfterDays > 0) + var days = DateTime.UtcNow.Date.Subtract(Model.Post.PubDateUtc.GetValueOrDefault()).Days; + + if (BlogConfig.ContentSettings.CloseCommentAfterDays > 0 && days > BlogConfig.ContentSettings.CloseCommentAfterDays) { - var days = DateTime.UtcNow.Date.Subtract(Model.Post.PubDateUtc.GetValueOrDefault()).Days; - if (days > BlogConfig.ContentSettings.CloseCommentAfterDays) - { -