diff --git a/components/com_content/views/article/tmpl/default.php b/components/com_content/views/article/tmpl/default.php
index a549b8c8957ac..77c1b2268add1 100644
--- a/components/com_content/views/article/tmpl/default.php
+++ b/components/com_content/views/article/tmpl/default.php
@@ -22,6 +22,10 @@
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
JHtml::_('behavior.caption');
+$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
+$isNotPublishedYet = $this->item->publish_up > $currentDate;
+$isExpired = $this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate();
+
?>
@@ -54,10 +58,10 @@
item->state == 0) : ?>
- item->publish_up) > strtotime(JFactory::getDate())) : ?>
+
- item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
+
diff --git a/components/com_content/views/category/tmpl/blog_item.php b/components/com_content/views/category/tmpl/blog_item.php
index aaf3432a708c5..1da735983a592 100644
--- a/components/com_content/views/category/tmpl/blog_item.php
+++ b/components/com_content/views/category/tmpl/blog_item.php
@@ -18,9 +18,12 @@
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
+$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
+$isUnpublished = ($this->item->state == 0 || $this->item->publish_up > $currentDate)
+ || ($this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate());
+
?>
-item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
- || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
+
@@ -79,9 +82,8 @@
-item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
- || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
-
+
+
diff --git a/components/com_content/views/category/tmpl/default_articles.php b/components/com_content/views/category/tmpl/default_articles.php
index 678c570147a20..751d8a520d0eb 100644
--- a/components/com_content/views/category/tmpl/default_articles.php
+++ b/components/com_content/views/category/tmpl/default_articles.php
@@ -20,9 +20,9 @@
$listDirn = $this->escape($this->state->get('list.direction'));
$langFilter = false;
-// Tags filtering based on language filter
+// Tags filtering based on language filter
if (($this->params->get('filter_field') === 'tag') && (Multilanguage::isEnabled()))
-{
+{
$tagfilter = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter');
switch ($tagfilter)
@@ -63,6 +63,10 @@
');
$tableClass = $this->params->get('show_headings') != 1 ? ' table-noheader' : '';
+
+$nullDate = JFactory::getDbo()->getNullDate();
+$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
+
?>