Problem With K2 Date Format

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 Nov 24, 2012 7:32 pm
Reply with quote
Report this post
Hi...

I've noticed that the K2 date format has a problem...
In the article the date format was 'Date Month Year', and there is no specific time format like 20:41 or 01:23 AM

Is it possible to change the date format to 'Date Month Year | HH:MM' (In PHP format = F d, Y H:i) in K2?

Thank You...
User avatar
Senior Boarder

GK User
Sat Nov 24, 2012 10:55 pm
Reply with quote
Report this post
Hi

Please open the following file ../templates/gk_gamenews/html/com_k2/templates/default/item.php

replace this line

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


with

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


Cheers ;)
User avatar
Platinum Boarder

GK User
Mon Nov 26, 2012 10:46 am
Reply with quote
Report this post
it works for me!
What about the same on k2 category items view?

and how would this work making changes on override?
User avatar
Junior Boarder

GK User
Mon Nov 26, 2012 11:54 am
Reply with quote
Report this post
dimitris7 wrote:it works for me!
What about the same on k2 category items view?

and how would this work making changes on override?


Hi

Please open ../gk_gamenews/html/com_k2/templates/default/category_item.php

replace this:

Code: Select all
<ul>
                  <?php if($this->item->params->get('catItemCategory')): ?>


with

Code: Select all
<ul>
                  <?php if($this->item->params->get('catItemDateCreated')): ?>
                  <!-- Date created -->
                  <li class="catItemDateCreated">
                  <?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
                  </li>
                  <?php endif; ?>
                  <?php if($this->item->params->get('catItemCategory')): ?>



Cheers
User avatar
Platinum Boarder

GK User
Mon Nov 26, 2012 12:10 pm
Reply with quote
Report this post
Works like a charm...
Thanks a lot Seichinha...
I appreciate your help...
:D
User avatar
Senior Boarder


cron