Keyword

How to change date format?

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #112130 by Yiota
Replied by Yiota on topic Re: How to change date format?
Have you chosen the Absolute or relative option for your comment date?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #112131 by Jan
Replied by Jan on topic Re: How to change date format?
Absolute... but if I chose relative i get very strange looking date like this: 2013-12-28 10:00:49
Thats no relative time stamp in my opinion, is it?

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #112132 by Yiota
Replied by Yiota on topic Re: How to change date format?
Do you use overrides for this module?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #112133 by Jan
Replied by Jan on topic Re: How to change date format?
no

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #112134 by Yiota
Replied by Yiota on topic Re: How to change date format?
Clean your site's and browser's cache and check again.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #112135 by Jan
Replied by Jan on topic Re: How to change date format?
I found the files I have to change now:

Its in the de-DE.mod_k2.j16.ini for the module output and in the de-DE.com_k2.j16.ini for the component output.
Both files are in the administrator > language folder...

So now i want to add some text to the translation. But the way I did it was not accepted... Why not?

I changed
K2_DATE_FORMAT_LC2="l, d F Y H:i"
into
K2_DATE_FORMAT_LC2="l, d F Y um H:i"
and the output is like
auf Donnerstag, 30 Januar 2014 00000001 11:52.

Why?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #112136 by Lefteris
Replied by Lefteris on topic Re: How to change date format?
You can't have words other than date parameters in this date language definition.

In case you need to add words I'm afraid that you have to break your date in two definitions, like

K2_DATE_FORMAT_LC2="l, d F Y"
K2_DATE_FORMAT_LC3="H:i"

and also change the file mod_k2_comments/comments.php (better create an template override of the module and make the modification there. Just copy the mod_k2_comments/tmpl/comments.php to templates/your_template/html/mod_k2_comments/).

Then locate this

<?php echo JText::_('K2_ON'); ?> <?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC2')); ?>

and change it to this

<?php echo JText::_('K2_ON'); ?> <?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC2')); ?> um <?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC3')); ?>

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #112137 by Jan
Replied by Jan on topic Re: How to change date format?
Ok thanks so far. That works for the module output. But how can i change the same thing in the component output? I tried to change the item.php in com_k2 > templates > default as i did for some other changes before but the code you told me doesn't work over here, even though the code seems to be the same as in the comments.php.

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #112138 by Yiota
Replied by Yiota on topic Re: How to change date format?
Did you update the language files de-DE.com_k2.ini with the new language definitions as well?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #112139 by Jan
Replied by Jan on topic Re: How to change date format?
Yes!


Btw: Why do I have to enter a captcha code everytime I post something? That is really annoying...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum