Page 1 of 1

date format of News module

Posted: Thu Jun 29, 2006 2:14 pm
by antuanjoseff
hi,

I have been trying the dateformat parameter of the news module because I want the day/month/Year format.

The problem is that the dateformat parameter only changes the format of the summarytemplate, and not the detailtemplate.
I tryed to put this {strftime($entry->formatpostdate)}  in the detailtemplate but is throwing an error.

Any suggestion?
thanks in advance

Re: date format of News module

Posted: Thu Jun 29, 2006 2:33 pm
by Elijah Lofgren
antuanjoseff wrote: hi,

I have been trying the dateformat parameter of the news module because I want the day/month/Year format.

The problem is that the dateformat parameter only changes the format of the summarytemplate, and not the detailtemplate.
I tryed to put this {strftime($entry->formatpostdate)}  in the detailtemplate but is throwing an error.

Any suggestion?
thanks in advance
This has been fixed in the SVN version of the News module.

In News SVN in the Options Tab there is a now a "Format to display the article's post date with." blank and if you put something like this in the blank:
%A, %b %d, %Y
Then, in the News Detail template, you can use

Code: Select all

{$entry->formatpostdate}
to get dates like:
Thursday, Jun 29, 2006

The nightly SVN snapshot doesn't seem to be generated anymore on this page: http://dev.cmsmadesimple.org/scm/?group_id=8

You'll either have to check it out with TortoiseSVN or Subversion or wait for the next version of the News module to be released. It requires CMSMS 1.0-svn so if you want to use it you will need to upgrade CMSMS to 1.0-svn also.

I run the SVN version of most of my sites. I have SVN News and CMSMS running here: http://www.elijahlofgren.com/blog/

Hope this helps.

Re: date format of News module

Posted: Sat Jul 01, 2006 9:38 pm
by mahjong
Too complicated for nothing.

Why not use smarty modifiers ?

Code: Select all

{$entry->postdate|date_format:"%e %B, %Y"}

Re: date format of News module

Posted: Sat Jul 01, 2006 9:53 pm
by Elijah Lofgren
mahjong wrote: Too complicated for nothing.

Why not use smarty modifiers ?

Code: Select all

{$entry->postdate|date_format:"%e %B, %Y"}
I hadn't thought of that. Good idea.  ;)

Re: date format of News module

Posted: Sun Jul 09, 2006 12:01 pm
by niq
Thanks - Just what I have been looking for to, to change the date format on the news template.

Using this type of approach:
{$entry->postdate|date_format:"%e %B, %Y"}

Re: date format of News module

Posted: Mon Jul 17, 2006 9:04 am
by alex7575
Does anyone know how to make a "setLocale" easily for the News module's date?

By default, the date is in english and i want to have it in french and italian or german... :)

Re: date format of News module

Posted: Tue Jul 18, 2006 2:54 am
by mahjong
1) Create a User Defined Tag with the following code inside

Code: Select all

setlocale(LC_TIME, 'french');
.

2) Named it has you wish. For instance, SetToFrench.

3) Insert {SetToFrench} on to top of the page that needs it.

Re: date format of News module

Posted: Tue Jul 18, 2006 6:40 am
by alex7575
mahjong wrote: 1) Create a User Defined Tag with the following code inside

Code: Select all

setlocale(LC_TIME, 'french');
.

2) Named it has you wish. For instance, SetToFrench.

3) Insert {SetToFrench} on to top of the page that needs it.
Hmmm thanx for the User Tag, I didn't think about it...
The thing that I've already tried to make a "setLocale(LC_TIME,'french');" on the top of my page in the template and it does not do anything on the news date :(

I call the news date with "$entry->formatdate".

Any idea why it does not work?

Re: date format of News module

Posted: Tue Jul 18, 2006 12:45 pm
by mahjong
Any idea why it does not work?
You need to apply the patch I've created for the News module so it can process user tags. Developpers are very slow integrating this solution in the official release. They told me they are to busy to notice patch submissions.

If you are not familiar with SVN patches, take a look at this explicite description of the solution.

Re: date format of News module

Posted: Tue Jul 18, 2006 3:58 pm
by Dr.CSS
did you use the {literal}your stuff {/literal} tags in the Source botton view to make your tag...