Page 1 of 1

Calandar date format

Posted: Mon Jan 30, 2006 2:50 pm
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.

Re: Calandar date format

Posted: Mon Jan 30, 2006 11:18 pm
by outdoorxtreme1
Do I need to modify the module itself?

Re: Calandar date format

Posted: Tue Jan 31, 2006 12:46 am
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"}

Re: Calandar date format

Posted: Tue Jan 31, 2006 12:51 am
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}

Re: Calandar date format

Posted: Tue Jan 31, 2006 5:03 am
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.

Re: Calandar date format

Posted: Tue Jan 31, 2006 10:27 pm
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"}

Re: Calandar date format

Posted: Tue Jan 31, 2006 11:09 pm
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. ;)

Re: Calandar date format

Posted: Wed Feb 01, 2006 3:30 pm
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.

Re: Calandar date format

Posted: Thu Feb 02, 2006 12:45 am
by iNSiPiD
Yep. Good input.

The Calendar module uses dates differently from the News module.

Re: Calandar date format

Posted: Fri Feb 17, 2006 9:53 am
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

Re: Calandar date format

Posted: Fri Feb 17, 2006 12:00 pm
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

Re: Calandar date format

Posted: Sun Feb 19, 2006 11:01 pm
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