Still seeking date help...

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sat Feb 22, 2014 3:52 am
Reply with quote
Report this post
Hey folks,

It's been a couple of months and I'm still seeking an answer to this:

In Publisher, the article published date displays as simply month and date - how can I get the year to show as well?

Thank you.
User avatar
Fresh Boarder

GK User
Sat Feb 22, 2014 10:06 am
Reply with quote
Report this post
Hi,
you have to add "Y" Year tag in article view and change some CSS.
I will check and add you more details...
User avatar
Platinum Boarder

GK User
Sat Feb 22, 2014 10:15 am
Reply with quote
Report this post
Few useful tips:

1) Inside: templates/gk_publisher\html\com_content\article\default.php
2) Open in editor and in edit mode find:
Code: Select all
<time datetime="<?php echo JHtml::_('date', $this->item->created, DATE_W3C); ?>">
      <?php echo JHtml::_('date', $this->item->created, JText::_('d M')); ?>
 </time>


You have to add "Y" after "M" (month) :
Code: Select all
<?php echo JHtml::_('date', $this->item->created, JText::_('d M Y')); ?>


3) Save changes
4) Override with this style to reduce size of font
Code: Select all
article > time {font-size: 22px; }
User avatar
Platinum Boarder

GK User
Sat Feb 22, 2014 3:09 pm
Reply with quote
Report this post
Thanks for that - certainly helpful (trying it now), but how would I go about adding the year to the date in the article itself - under the article title? It, too, simply shows the month and day in the Publisher template.
User avatar
Fresh Boarder

GK User
Sat Feb 22, 2014 3:28 pm
Reply with quote
Report this post
This same file line 106
Code: Select all
<?php echo JHtml::_('date', $this->item->created, JText::_('F j, Y')); ?>

remove "." before "Y" , must be:
Code: Select all
<?php echo JHtml::_('date', $this->item->created, JText::_('F j Y')); ?>
User avatar
Platinum Boarder

GK User
Sat Feb 22, 2014 3:33 pm
Reply with quote
Report this post
Thank you! Very much appreciated :)
User avatar
Fresh Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.