Keyword

Change the way the published date is displayed

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 4 days ago #165484 by Daily Deals UK
Change the way the published date is displayed was created by Daily Deals UK
Hi again,

I am wondering if someone could help me change the way the published date shows. At present it is "Wednesday, 22 November 2017 22:41" But I would like to have it show like this " Found 6 h, 50 m ago"

I know I have to change the variables for the dates in

/administrator/language/en-GB/en-GB.com_k2.j16.ini
and
in /language/en-GB/en-GB.com_k2.ini

But no idea what strings would work.

Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 days ago #165489 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change the way the published date is displayed
Hello there, this could be a custom language string, you will also need to check your overrides to verify this and set your relative date.

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

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

  • Daily Deals UK
  • Daily Deals UK's Avatar Topic Author
  • Offline
  • Junior Member
More
7 years 18 hours ago #165517 by Daily Deals UK
Replied by Daily Deals UK on topic Change the way the published date is displayed
Hi Krikor

Sorry that made absolutely no sense to me :/

You have what I want on this form, when an item is posted it says how long ago rather than the actual date.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #165556 by Krikor Boghossian
Replied by Krikor Boghossian on topic Change the way the published date is displayed
Hello,

You can find a comprehensive guide of how to here: php.net/manual/en/datetime.formats.relative.php

Information on overrides (which you are already using) is here:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

The created date is:
github.com/getk2/k2/blob/master/components/com_k2/templates/default/item.php#L38

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

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


Powered by Kunena Forum