From b0eac79d7ad518de515fbb98bfd37c3754ec19a2 Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Fri, 5 Jul 2019 17:22:32 +0500 Subject: [PATCH] feat(modified): show Last Updated only if the difference between created and modified is more than a day --- templates/_includes/last_updated.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/_includes/last_updated.html b/templates/_includes/last_updated.html index f7facea6..9ccd54e4 100644 --- a/templates/_includes/last_updated.html +++ b/templates/_includes/last_updated.html @@ -3,10 +3,12 @@ If it is >3.3 than modified is a datetime object #} {% if article.locale_modified and article.modified %} - +{% set delta = (article.modified - article.date).days %} +{% if delta > 0 %}

Last Updated

{% set day = article.modified.strftime('%d')|int %} +{% endif %} {% elif article.modified %}

Last Updated