Article date

Professional Joomla restaurant template comes with a custom animated modules and advanced typography elements.
GK User
Sat May 26, 2012 11:47 pm
Hello!
First of all, nice template. I have a little problem with the display date of the k2 articles, I want the "dd mm yyyy" format but I can't make it visible the year. My site is http://www.gradina-bunicii.ro.
Tnx.
User avatar
Fresh Boarder

GK User
Sun May 27, 2012 12:19 am
Find File: /templates/gk_restaurant/html/com_k2/templates/default/item.php
Find Lines: 29 to 32 which is below
Code: Select all
      <time datetime="<?php echo JHTML::_('date', $this->item->created, JText::_('d M Y h:i')); ?>">
            <?php echo JHTML::_('date', $this->item->created, JText::_('d')); ?>
            <span><?php echo JHTML::_('date', $this->item->created, JText::_('M')); ?></span>
      </time>

Replace with below
Code: Select all
      <time datetime="<?php echo JHTML::_('date', $this->item->created, JText::_('d M Y h:i')); ?>">
            <?php echo JHTML::_('date', $this->item->created, JText::_('d')); ?>
            <span><?php echo JHTML::_('date', $this->item->created, JText::_('M')); ?></span>
            <?php echo JHTML::_('date', $this->item->created, JText::_('y')); ?>
      </time>

Result, See you around...
Image
User avatar
Platinum Boarder

GK User
Mon May 28, 2012 10:20 am
Hello, norman.
Thanks for your quick response. It works but only partially, because it shown just the two last digit of the year.
Tnx.
User avatar
Fresh Boarder

GK User
Mon May 28, 2012 11:07 am
Try capital "Y"

Code: Select all
   <time datetime="<?php echo JHTML::_('date', $this->item->created, JText::_('d M Y h:i')); ?>">
            <?php echo JHTML::_('date', $this->item->created, JText::_('d')); ?>
            <span><?php echo JHTML::_('date', $this->item->created, JText::_('M')); ?></span>
            <?php echo JHTML::_('date', $this->item->created, JText::_('Y')); ?>
   </time>


See you around...
User avatar
Platinum Boarder

GK User
Tue May 29, 2012 10:05 pm
Thanks, works like a charm. You can mark the thread as solved.
User avatar
Fresh Boarder


cron