Page 1 of 1
News Module: formatpostdate
Posted: Wed Oct 01, 2008 11:07 am
by Evil Phil
How do I change the format of formatpostdate, e.g. I want to display dd-MMM-yyyy. Format post date being:
Code: Select all
{if $entry->formatpostdate}
<div id="NewsPostDetailDate">
{$entry->formatpostdate}
</div>
{/if}
Re: News Module: formatpostdate
Posted: Wed Oct 01, 2008 2:12 pm
by Duketown
Evil Phil,
1st answer: RTFM.
2nd: use %d-%b-%G in the options tab on the field 'Format to display...'
Duketown
Re: News Module: formatpostdate
Posted: Mon Oct 06, 2008 1:11 pm
by Evil Phil
I did RTFM, couldn't find an answer (which isn't unusual for the FM) hence I asked the question. But thanks for pointing it out to me.
Re: News Module: formatpostdate
Posted: Mon Dec 22, 2008 4:23 pm
by Weon
At the risk of being flamed, can I hop on this one?
I have been trying to format my New items dates but don't seem to have the option of entering a chosen format anywhere other than in the Global Settings for the site (and changing this doesn't seem to have any effect).
I have looked on the Options tab for the News module and there is no option relating to Date formatting.
I am using 1.5.1 with News Module 2.9.1.
{$entry->postdate} works fine.
{$entry->formatpostdate} doesn't, but I assume this means that it's because I have no way of setting this value at the moment.
Any thoughts?
Don't know if it'll help but here is my system info:
----------------------------------------------
Cms Version: 1.5.1
Installed Modules:
* CMSMailer: 1.73.14
* FileManager: 0.4.3
* MenuManager: 1.5.3
* ModuleManager: 1.2.1
* News: 2.9.1
* nuSOAP: 1.0.1
* Printing: 0.2.6
* Search: 1.5.2
* ThemeManager: 1.0.8
* TinyMCE: 2.4.10
* CGSimpleSmarty: 1.3.1
* FormBuilder: 0.5.5
Config Information:
* php_memory_limit:
* process_whole_template: true
* max_upload_size: 2000000
* default_upload_permission: 664
* assume_mod_rewrite: true
* page_extension:
* internal_pretty_urls: false
* use_hierarchy: true
Php Information:
* phpversion: 5.2.6
* md5_function: On (True)
* gd_version: 2
* tempnam_function: On (True)
* magic_quotes_runtime: Off (False)
* memory_limit: 16M
* max_execution_time: 30
* safe_mode: Off (False)
* session_save_path: No check because open basedir active
Server Information:
* Server Api: apache2handler
* Server Db Type: MySQL (mysql)
* Server Db Version: 4.1.22
----------------------------------------------
Re: News Module: formatpostdate
Posted: Mon Dec 22, 2008 7:30 pm
by RonnyK
formatpostdate is deprecated in 1.5.1, you should use postdate now....
In GlobalSettings, you can set the global dateformat based on strftime, to have the date shown formatted....
Ronny
Re: News Module: formatpostdate
Posted: Mon Dec 22, 2008 7:47 pm
by JeremyBASS
tryed {$entry->postdate|date_format:"%m%d%y"} ??
Re: News Module: formatpostdate
Posted: Tue Dec 23, 2008 10:40 am
by Weon
Awesome, thanks guys.
On a side note, I did try changing the global setting but it didn't seem to format the date beyond its default setting.
I expect I was doing something lame - will carry on playing with it.
Merry Christmas!