- Posts: 438
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- K2 Power Tip: Change Extra Field Date format - K2 Hack
K2 Power Tip: Change Extra Field Date format - K2 Hack
- Joe Campbell
-
Topic Author
- Offline
- Platinum Member
Less
More
9 years 9 months ago #145024
by Joe Campbell
K2 Power Tip: Change Extra Field Date format - K2 Hack was created 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/
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 9 months ago #145032
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.
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
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 438
9 years 9 months ago #145038
by Joe Campbell
Replied by Joe Campbell on topic K2 Power Tip: Change Extra Field Date format - K2 Hack
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.
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 9 months ago #145061
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.
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.
- Forum
- K2 Community Forum
- English K2 Community
- K2 Power Tip: Change Extra Field Date format - K2 Hack