Date Format in Comments: How I Altered Displayed Dates

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Date Format in Comments: How I Altered Displayed Dates

Postby JulioFranco » Tue Jun 17, 2014 4:45 pm

This was not easy to change from the default. I assumed that I could change the format of the displayed date field in the comments by simply changing a Config or Advanced Config parameter, but all changes there were ignored.

Finally found something that worked! This may not be the best way, but it works and I've made note of it so I can incorporate the change in future upgraded code releases.

1. Edit this file, either on your computer to be uploaded, or directly via cPanel or other web interface into your web site:
/pivotx/modules/module_smarty.php

2. Search for the first occurrance of ""%day%-%month%-&rsquo;%ye%" <--- Displays in comments as 17-06-2014>

3. Change this to whatever you want it to be. I changed it to "%month%-%ordday%-%year% <--- Displays in comments as 06-17-2014>

For other date display options, read the manual. Or flip the parameters shown above into the order you prefer. You can also use slashes if preferred, rather than dashes.
JulioFranco
 
Posts: 1
Joined: Tue Jun 17, 2014 3:54 pm

Re: Date Format in Comments: How I Altered Displayed Dates

Postby Harm10 » Tue Jun 17, 2014 4:51 pm

Have you read the documentation about the date display within the comments tag? http://book.pivotx.net/page/app-b#anchor-comments
It also points to the appendix containing the date formatting options.

And warning: you shouldn't change core files of PivotX without realising that those files could be changed in a next release.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Date Format in Comments: How I Altered Displayed Dates

Postby hansfn » Tue Jun 17, 2014 9:23 pm

What harm is saying is that you just replace

Code: Select all
[[ comments ]]

with

Code: Select all
[[ comments date="%month%-%ordday%-%year%" ]]

in your templates. Never, ever change the core files.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 6 guests

cron