IMPORTANT MESSAGE REGARDING THE FORUM

As you may already know, the JoomlaWorks Forum is powered by Kunena (the only decent forum component for Joomla).

Unfortunately, the latest update for Kunena has seemingly broken all code snippets (old and new) in the forum.

Until this message is removed, please paste any code as regular text - in other words, don't use the [code]...[/code] tags in Kunena's post editor.

Keyword

Display age in the present

  • saovry
  • saovry's Avatar Topic Author
  • Offline
  • Senior Member
More
5 months 1 week ago #178100 by saovry
Display age in the present was created by saovry
I have a question about Extract Field date on K2..

the Field of Date, user select the date and it can show the age.

Do you have any code of it?

If ueser select 10/02/2010, so the result will display " 11 Years OLd and 03 months"

thank..

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

More
5 months 1 week ago - 5 months 1 week ago #178116 by Fotis
Replied by Fotis on topic Display age in the present
Run this check in the foreach loop that prints out the extra fields:
www.php.net/manual/en/function.date.php) to render rawValue; ?> to anything you like.			

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member
Last edit: 5 months 1 week ago by Fotis.

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

  • saovry
  • saovry's Avatar Topic Author
  • Offline
  • Senior Member
More
5 months 1 week ago #178139 by saovry
Replied by saovry on topic Display age in the present
Sorry, could you give me a little more guide..

Where could I pass this code into?
Where could I overwrite it when I update K2 so the code still in there. The code will lost..

thank u..

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

More
5 months 6 days ago #178151 by Fotis
Replied by Fotis on topic Display age in the present
If you know basic PHP coding, it should not be an issue for you to find the extra fields foreach loop and modify it to get the raw date value. If you need more explaining, then what you ask is beyond the support provided in this forum.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • saovry
  • saovry's Avatar Topic Author
  • Offline
  • Senior Member
More
4 months 1 week ago - 4 months 1 week ago #178360 by saovry
Replied by saovry on topic Display age in the present

If you know basic PHP coding, it should not be an issue for you to find the extra fields foreach loop and modify it to get the raw date value. If you need more explaining, then what you ask is beyond the support provided in this forum.


Dear Fotis,
If you don't mind, could you tell me which files that I need to go working on because I don't know files location and files's name that I need to work on them.
It is my first time that I customize the code and I don't know about the files name/location.

I tried to go component/k2 (There are many folders and files here.)

If I want to display age with these link which files and location.. Could you share with me...
khmercdp.org/index.php/component/k2/item/314-khm0060494
khmercdp.org/index.php/component/k2/itemlist/category/6-khm006

thank
 
Last edit: 4 months 1 week ago by saovry.

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

More
3 months 3 weeks ago #178428 by Fotis
Replied by Fotis on topic Display age in the present
Create a set of K2 template overrides inside your current Joomla template. Follow this guide: getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates

Then all you have to do is work on the default/item.php file AFTER you've created any relevant extra fields of course (so you have the data to work with).

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum