Article publication date format does not include the year - Forum | JoomShaper
Solved Templates

Article publication date format does not include the year

Asked by Moises Perez Gutierrez 5 years ago Last activity 5 years ago

Hi Joomshaper team,

I have the template newskit working in my joomla template. I manage an online newspaper containing hundreds of articles.

All articles shows in the header: author, publication date and number of views.

But the publication date is really confusing as it does not show the year. I don´t know how to change that format and add the year. Could you guide how to get it?

Thank you in advanced.
Regards.

Accepted answer

Marked as the solution
Ariba Staff
5 years ago · edited

Thank you.

Can you please check now?

I have added the code in this file /layouts/joomla/content/infoblock/createdate.php

And now the calendar icon is showing.

<i class="fa fa-calendar"></i>

Please let me know if that is alright now.

11 more replies

Rashida Rahman Staff

Hi there!

Thanks for your query.

Let me have a look into it.

Best Regards

Ariba Staff
5 years ago · edited

I have checked from my end.

Can you please go to System -> Global configuration then Article Option and scroll down. You will find "Show create Date" Have you tried to enable this?

newskit-year.JPG

newskit-year-demo.JPG

Moises Perez Gutierrez Asked this

Hi Ariba,

It works as you indicated, so great. Thanks a lot. It could be a solution!!! :)
However, I don´t want to show 2 dates in an article. It seems confusing to me.

Thus, I have switch off "publication date".

When I have done it, I have lost the "date icon in the left". You can see by yourself in the image below.

https://www.encomienda.es/images/2021/07/22/2021-07-22_18-43-02.jpg
https://www.encomienda.es/images/2021/07/22/2021-07-22_18-43-40.jpg

Regards.

Ariba Staff
5 years ago · edited

You're most welcome.

You can edit this file: /layouts/joomla/content/info_block/create_date.php and insert the following code here as shown in the screenshot below. This will add the calendar icon.

<i class="fa fa-calendar"></i>

newskit-create-date-icon.JPG

OR,

You can also change this file: /layouts/joomla/content/info_block/publish_date.php and add the character 'Y' as shown in the screenshot below (red underlined) - which will add the year value to publish date. This is the first date that was showing by default without the year value.

newskit-publish-date-format.JPG

Please do let me know if that works and if you have any confusion.

Moises Perez Gutierrez Asked this

Hi Ariba,

When I choose your first solution, I see that the content of the file "create_date.php" is pretty different than yours. There is a "span" tag which seems to have a relationship with the icon.
Anyway, whether I keep the tag span wether I replace it by your "<i class... etc>", it does not change anything in the frontend.

Regarding the second solution, I think something is not working as expected. The content of my file is a bit different than yours, and I can even delete it (my "publish_date.php") without any effect on the frontend. The publication date keeps showing as "Jul 22, 07:24 am".

Notice that for the first solution I have kept the global adjustment "Show create date" to ON, and the "Show Publish Date" to OFF, and I have setup the opposite for the second solution.

Download both of my files in the link:

https:///www.encomienda.es/images/2021/07/22/date_files.zip

Thanks a lot
Regards

Ariba Staff

Hello

Could you kindly provide your administrative access? Use the hidden mode to share the log in credentials.

Moises Perez Gutierrez Asked this

Hi Ariba,

Here you have them, in the hidden area.
Thanks.

Moises Perez Gutierrez Asked this

Hi Ariba,

Now it´s working, thanks a lot!
What did you do finally?

Regards.

Ariba Staff

Hello

You are most welcome :)

I have added the following code in this file /layouts/joomla/content/infoblock/createdate.php

<i class="fa fa-calendar"></i>

This is inserting the icon before the date-time value.

Log in to reply.