date format display in Editor

8 posts by 2 authors in: Forums > CMS Builder
Last Post: April 28, 2011   (RSS)

By (Deleted User) - April 27, 2011 - edited: April 27, 2011

Hi,

I have a "Date Field" in the editor. It shows now for example as 2011-04-16.

Anyway to show this as April 16, 2011 or even, Saturday, April 16, 2011?

This is only in the editor not in the published pages. See attached.
Attachments:

cms_001.gif 21K

Re: [RapidWeb] date format display in Editor

By Djulia - April 27, 2011 - edited: April 27, 2011

Hi,

Robin wrote a plugin to do this.

You can modify the format of the date, line 25.

Djulia

P.S. : Robin, thank you again !
Attachments:

listviewdateformat.php 2K

Re: [Djulia] date format display in Editor

By (Deleted User) - April 28, 2011

Thank you for the plugin. But where do I place this PHP file? Which directory/folder?

Re: [RapidWeb] date format display in Editor

By Djulia - April 28, 2011

Hi,

in folder /plugins/

...you must then activate the plugin in Admin > Plugins.

Djulia

Re: [Djulia] date format display in Editor

By (Deleted User) - April 28, 2011

Thank you so much for your help! If you don't mind, can I have the script to display this format:

Saturday, April, 30, 2011

I don't care for the time to display.

I tried playing with PHP script and I am getting an error. Please see attached screen shot.

Thank you again for all your help!
Attachments:

cms_screen_shot.gif 54K

Re: [RapidWeb] date format display in Editor

By Djulia - April 28, 2011 - edited: April 28, 2011

>> [font "Verdana"]Saturday, April, 30, 2011
You can test line 25 : $dateFormat = "l, F, d, Y";

… and for the error line 20 : strtotime(@$displayValue) ?

Djulia

Re: [RapidWeb] date format display in Editor

By Djulia - April 28, 2011 - edited: April 28, 2011

In Fact, according to the message I think that strtotime($displayValue) causes an error because $displayValue is indefinite (the variable does not have any value).

You can test @strtotime($displayValue) ?

Djulia