News Module: formatpostdate

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Evil Phil
Forum Members
Forum Members
Posts: 23
Joined: Fri May 09, 2008 10:36 am

News Module: formatpostdate

Post 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}
CMS Made Simple 1.4.1, PHP Version 5.2.5, MySql 5.0.45, Apache 2.2.26 on WAMP5 (Windows XP Pro)
Duketown

Re: News Module: formatpostdate

Post by Duketown »

Evil Phil,

1st answer: RTFM.
2nd: use %d-%b-%G in the options tab on the field 'Format to display...'

Duketown
Evil Phil
Forum Members
Forum Members
Posts: 23
Joined: Fri May 09, 2008 10:36 am

Re: News Module: formatpostdate

Post 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.
Last edited by Evil Phil on Mon Oct 06, 2008 1:18 pm, edited 1 time in total.
CMS Made Simple 1.4.1, PHP Version 5.2.5, MySql 5.0.45, Apache 2.2.26 on WAMP5 (Windows XP Pro)
Weon
Forum Members
Forum Members
Posts: 23
Joined: Sun Dec 07, 2008 10:42 am

Re: News Module: formatpostdate

Post 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


----------------------------------------------
Last edited by Weon on Mon Dec 22, 2008 4:47 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: News Module: formatpostdate

Post 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
JeremyBASS

Re: News Module: formatpostdate

Post by JeremyBASS »

tryed {$entry->postdate|date_format:"%m%d%y"} ??
Weon
Forum Members
Forum Members
Posts: 23
Joined: Sun Dec 07, 2008 10:42 am

Re: News Module: formatpostdate

Post 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!
Post Reply

Return to “Modules/Add-Ons”