How to change date in Article addons | Newskit - Documentation | JoomShaper

Newskit

Updated Last: 04 October 2018

How to change date in Article addons

To change date format displayed in Article and Articles Headline addon you have to edit two template files:

  • templates\newskit\sppagebuilder\addons\articles\site.php
  • templates\newskit\sppagebuilder\addons\articles_headline\site.php

In Article addon date format is defined by PHP DateTime format. Find below line in code editor:

$output .= '<span class="sppb-meta-date" itemprop="dateCreated">' . Jhtml::_('date', $item->created, 'M d, H:i a') . '</span>';

Where: Y- year, m - month (number), M - month (name),  d - the day of the month (from 01 to 31), H - 24-hour format of an hour (00 to 23), i - minutes etc.

Note: These functions depend on the locale settings of your server.

In Article Headline addon date format is defined by Joomla format from your local translation, in mentioned above file find & edit this line:

 $output .= '<span class="sppb-meta-date" itemprop="dateCreated">' . Jhtml::_('date', $item->created, 'DATE_FORMAT_LC3') . '</span>';

Date formats from Joomla! language\en-GB\en-GB.ini file:

DATE_FORMAT_LC="l, d F Y"
DATE_FORMAT_LC1="l, d F Y"
DATE_FORMAT_LC2="l, d F Y H:i"
DATE_FORMAT_LC3="d F Y"
DATE_FORMAT_LC4="Y-m-d"
DATE_FORMAT_LC5="Y-m-d H:i"
DATE_FORMAT_JS1="y-m-d"

Note: Order of date symbol depend on the locale translation file, so please check your es-ES.ini, de-DE.ini, pl-PL.ini etc. file first.