Keyword

K2 Power Tip: Change Extra Field Date format - K2 Hack

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
8 years 10 months ago #145024 by Joe Campbell
If you're ok with hacking K2, you can modify the date format of the Extra Field Date:

File:
/components/com_k2/models/item.php

Find:
$value = JHTML::_('date', $value, JText::_('K2_DATE_FORMAT_LC'), $offset);

Replace K2_DATE_FORMAT_LC with the format that you desire, for example: l d F Y [or] mdY

Check this article by Steven Johnson (Intown Web Design) for date options/ideas:
www.jbeginner.com/tutorials/extensions/how-to-format-the-k2-date-time/

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 10 months ago #145032 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Power Tip: Change Extra Field Date format - K2 Hack
Hello Joe,

This is actually a core file edit.
It is best to use language overrides, since you will lose your edits when you update.

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

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

  • Joe Campbell
  • Joe Campbell's Avatar Topic Author
  • Offline
  • Platinum Member
More
8 years 10 months ago #145038 by Joe Campbell
I know hacking the core is bad, but wouldn't changing the Language File as you suggested create a "Global" change?

In my case (as possible with others) I only want to change the date format for the extra fields and nowhere else.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145061 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Power Tip: Change Extra Field Date format - K2 Hack
Hmm, I have to agree with you.
Changing all other dates will take too much time.

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