Blog Macro Showing wrong date

I am having an issue with the Blog macro. It is displaying the wrong date of the published stroy, even though on the stories actual page, the publish date is correct. Any idea what might be causing this?

Here is the code i am using to display the macro:

 (% class="box" %)
(((
{{blogpostlist blog="Blog.WebHome" category="Blog.CEO's Blog" fromDate="2017-06-01" params="displayTitle=true|useSummary=true" layout="image" limit="1"/}}
)))

But this is what i get

Capture

It should show the date 03/20/2018 instead of the 2017 date.
Any help will be greatly appreciated.

Could you go to the blog page and edit in object mode and check the publish date there?

@vmassol the publish date in object mode seems fine. With regards to the question of the server time, it is also fine as the server is on the current date and time.

Capture

Ok so it seems the issue is in the image blog post layout from what I see on http://extensions.xwiki.org/xwiki/bin/view/Extension/Blog%20Application#HExamplesofpostlayouts

Note that I’ve never used this version of the blog app. So I guess someone needs to check the code for this layout.

I did a quick search and it seems it could be this code: https://github.com/xwiki-contrib/application-blog/blob/master/application-blog-ui/src/main/resources/Blog/BlogPostLayoutImage.xml#L222

So we need to check:

#getEntryDate($postDoc $postObj $postDate)

since apparently it’s postDate that is displayed.

EDIT: hmmm getEntryDate seems to be tbe publish date, see https://github.com/xwiki-contrib/application-blog/blob/f6582962d70db69015341c23614e024d6f58b3c9/application-blog-ui/src/main/resources/Blog/BlogCode.xml#L537

So if the publish date is ok then it means it’s the display algorithm that is wrong (it looks overly complex BTW).

Awwww bummer, so no fix on my end i assume? is there a way to NOT show the date? The other posts dont show the date so it works fine in that regard.

You can do something on your side for sure! You just need to debug it in the wiki pages making up the blog post app to see where the problem comes from. That’s very easy to do and shouldn’t take you more than an 1 hour or so at max.

I gave the links corresponding to the wiki pages.

For example: Blog.BlogPostLayoutImage.

You can edit this page and print stuff to see where the problem is. You can even remove the displaying of the date but it would be better to understand the problem. I’m sure it’s very easy to fix.

Hi @vmassol apologies for such a late reply. Was away from this project for a bit. So i took heed of your advice, and i figure for now i would like to at the very least hide the date. As i figure out how to debug in xwiki(i am still learning the ropes). I am looking at the velocity scripts, what would i have to change in order to make the dates disapear on the blog preview?

https://pastebin.com/UBj160ud

Could you raise a JIRA issue on https://jira.xwiki.org/projects/BLOG about the issue with the wrong date being displayed? Please make sure you provide the max details so that we can reproduce.

You would need to read the scripts: I provided some hints already above but I don’t have the time to do more FTM.

Thanks

Noted with Thanks.