Editing "created date" format

More
12 years 1 week ago #30865 by conticreative
In my FC article I am unable to edit the format of the "created" date.

Currently it looks like this:
[Sunday, 16 September 2012 07:00]

But I need it to look like this:

16 September 2012

I went to change the date format in the field editor but it seems to have no effect on the display at all.
I edited the "Created" core filed.

In the template code it looks like this:

<?php FlexicontentFields::getFieldDisplay($this->item, 'created', $values=null, $method='display'); ?>
<?php echo '->value[0], JText::_('DATE_FORMAT_LC2')).']'; ?>

and as far as I can understand it, the format is set by DATE_FORMAT_LC2 and the brackets included in the PHP code.

That seems a bit silly to me. Why is there a custom format field if it doesn't work? Or am I not understanding something?

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

More
12 years 1 week ago #30868 by conticreative
Found it. I had to add the field in the template layout and it worked. Only now I have two dates and I had to hack the original out of there in the template to make sure no one would add it by mistake and now I don't have a granular override for it either. It's either going to be everywhere this template is used or not.

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

More
12 years 1 week ago #30900 by ggppdk
Thanks for feedback !!! ;)

Right field display and value are not set unless you place it a template position this a important performance change since v1.5.6RC2 that greatly improve speed in category views

but since the need value is a core item property

you could also have used:

$this->item->created
instead of
$this->fields->value[0]

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
12 years 1 week ago #31020 by conticreative
Thank you for the kind reply.

I am not sure I understand what using:

$this->item->created

instead of:

$this->fields->value[0]

is supposed to accomplish. I went back and reactivated the core date field "created" and now the old date has reappeared along the one I inserted.

As far as I can tell, it's still not changing the date format.
I edited DATE_FORMAT_LC2 in languages/english/en-GB.ini to read:

DATE_FORMAT_LC2="l, F j, Y"

which should give me something like:
Sunday, September 16, 2012

but I am still getting:

Sunday, 16 September 2012 07:00

I have also changed the code in item.php in my FC template to read DATE_FORMAT_LC3 or 4, etc and while the date format does change, it does not change according to the values I enter. it's like it's getting its date format elsewhere, but I cannot figure out from where. Is there another file that is being referenced?

But even if I were able to change the date by editing the ini file, being able to override the file at the administration level is still preferable because it overrides any possible future updates to the joomla core files.

this is not a life and death issue, but I am curious to learn more about it.

Thank you kindly.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.436 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline