Calandar date format

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
outdoorxtreme1

Calandar date format

Post by outdoorxtreme1 »

I need help changing the date format for the calendar event template. Currently it shows - 5 March 2006

I want it to be - 03/05/06

How do I do this. I tried changing some if the settings of the template with no luck.
outdoorxtreme1

Re: Calandar date format

Post by outdoorxtreme1 »

Do I need to modify the module itself?
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm

Re: Calandar date format

Post by Greg »

you need to set the date_format parameter in the tag to %d/%m/%y

e.g.

{cms_module module="Calendar" date_format="%d/%m/%y"}
Greg
outdoorxtreme1

Re: Calandar date format

Post by outdoorxtreme1 »

I tried this tag in my template and it didn't work.

{cms_module module="Calendar" date_format="%m/%d/%y" summaries=true display="upcominglist" table_id="cal-upcominglist" limit=3}
iNSiPiD

Re: Calandar date format

Post by iNSiPiD »

I had the same issue since News was upgraded to v2. Neither the 'date_format' nor the 'more' attributes worked any more.

I seem to have resolved this somehow but it's not in the templates or the module call, which means I must have hacked it at some stage.

At the moment I have two different date formats for my News and Site Updates and th eonly difference in the templates is that one checks for 'formatpostdate' and the other for 'postdate'.

e.g.

Code: Select all

{if $entry->formatpostdate}
	<div class="NewsSummaryPostdate">
		{$entry->formatpostdate}
	</div>
{/if}
Can someone "in the know" please provide the correct steps for altering the date format? I thought it was now done through the templates but am not sure what syntax to use.
iNSiPiD

Re: Calandar date format

Post by iNSiPiD »

Helpful as ever, Patricia. That's exactly the answer we needed.

It would be nice to know what other paramters can be defined using this syntax.

{$entry->postdate|date_format:"%d/%m/%y"}
iNSiPiD

Re: Calandar date format

Post by iNSiPiD »

Thanks again, Patricia. It's hard to know sometimes where the CMS stops and Smarty begins.

A case in point is Smarty's email tag which already handles various types of encryption. Why do we bother having a plugin that does the same thing but uses javascript to achive its goal. Seems silly. I could also mention the phpinfo module -- but i won't. ;)
outdoorxtreme1

Re: Calandar date format

Post by outdoorxtreme1 »

Wouldn't work for me this way but I found another way. In the template I moved:

{$month_names[$month_number]}

and

{$event.event_date_start|date_format:"%e"}

around in the template to get it to output how I wanted the date to look.
iNSiPiD

Re: Calandar date format

Post by iNSiPiD »

Yep. Good input.

The Calendar module uses dates differently from the News module.
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

Re: Calandar date format

Post by fredt »

;D As usual, this answer saved me... Thanks Patricia !

This support forum is by far THE BEST I've seen in my 20 years as consultant ! Even experts-exchange is far behind...

Fred
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

Re: Calandar date format

Post by fredt »

I'd like to... perhaps on Tips & Tricks or FAQ section... But I'm just a nOOb, and have no time at all... my wife already went mad yesterday about me & computers!

OK, I'm going to play Loto, so I'm rich and am forced to earn my money anymore  ;)

BTW, I'd like to see Calendar without installing it (cf a previous post) - can somebody post a link, just to see this Calendar ?

Fred
iNSiPiD

Re: Calandar date format

Post by iNSiPiD »

fredt,

To install, you only have to click Install in the Extensions->Modules screen and then add the tag to a page. It's very simple. The harder part is styling it the way you like with CSS.

Here's an example with no events in it.

http://d81314.i50.quadrahosting.com.au/events-calendar
Locked

Return to “CMSMS Core”