Keyword

Change date format in date extrafield - MissionIMP

  • chemicalbr
  • chemicalbr's Avatar Topic Author
  • Offline
  • New Member
More
11 years 7 months ago #103082 by chemicalbr
:pinch:
Hi!
I have trying for 3 days to change the date format of date extra field here :
remontiram.com/
and here:
remontiram.com/offer-trip/item/10-%D0%BF%D1%8A%D1%82%D1%83%D0%B2%D0%B0%D0%BD%D0%B5-%D0%B4%D0%BE-%D0%BF%D0%BB%D0%B5%D0%B2%D0%B5%D0%BD

First is k2filtrify module second link is item view page.

I want dates in date extrafield in format YYYY MM DD ?

I have tried changing values in language files in bulgarian, language overrides but its not working ?
Maybe it is the calendar inputing the value in the backend ?
I didn't manage to change the format of calendar here
/administrator/components/com_k2/models/extrafield.php

"
$output = JHTML::_('calendar', $active, 'K2ExtraField_'.$extraField->id, 'K2ExtraField_'.$extraField->id);
"
Please help.

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

More
11 years 7 months ago #103083 by Lefteris
Hi. Go to your language file and set the desired format by translating the "K2_DATE_FORMAT_LC" variable. Note that this will change the date format in other places too, where this variable is used.

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

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

  • chemicalbr
  • chemicalbr's Avatar Topic Author
  • Offline
  • New Member
More
11 years 7 months ago - 11 years 7 months ago #103084 by chemicalbr
Hi
I did that ,and noting happened!
I have changed :

K2_DATE_FORMAT_LC2="%Y %m %d" and
K2_DATE_FORMAT_LC="%Y %m %d"

and in the frontend it is still
Четвъртък, 20 Септември 2012

Again this is an extra field

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

More
11 years 7 months ago #103085 by Lefteris
Did you changed the right file? The one for the current language and not the English one? Also if you are under Joomla! 2.5 the formatting should not include the percentage character. Take a look at the en-GB.com_k2.ini file and translate accordingly.

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

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

More
11 years 6 months ago #103086 by Pelle Joens
Hi,

I had the same problem and changing the language-files did not solve it. But after a little research I found this "solution":

Add a language-override with the key: "K2_DATE_FORMAT_LC" and the text :"d. M Y". It works fine!

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

More
11 years 3 months ago #103087 by Matt
Lefteris, it seems these keys are hardcoded:

K2_DATE_FORMAT_LC2="%A, %d %B %Y %H:%M"
K2_DATE_FORMAT_LC="%A, %d %B %Y"

Changing them in the ini files won't have any effect. In fact, you can delete them and nothing will change.
As Pelle Joens said, you can work around this by overriding keys in joomlas ACP but without the %.

If this bug has already been reported, forget it, if not, please fix it, thanks.

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

More
11 years 2 months ago #103088 by snlr
Hi,

could you explain how this works exactly "Add a language-override"?

If not in one of the language ini files where else is this added?


thank you

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

More
11 years 2 months ago - 11 years 2 months ago #103089 by mikexcite
Weirdly, K2 defines the date format in the ini files in administrator language files. Finally finding and changing those worked for me. Change en-GB.com_k2.j16.ini and you could be good to go.

I'm no expert so I can't tell you more than that except I beat my head against my keyboard for an hour last night wondering why changing the normal language files didn't do anything. K2 shouldn't have the entires in the normal language files if they don't do anything.

Credit and thanks to this guy.

Note, you can make new date formats here just as easily, get more customization and not accidentally break things elsewhere. I have K2_DATE_FORMAT_MONTH and K2_DATE_FORMAT_YEAR for when I need those.

Mike

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


Powered by Kunena Forum