cms_date_format: how to change default time format in CGcalendar Template

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jcknight
New Member
New Member
Posts: 5
Joined: Fri Sep 10, 2010 3:50 am

cms_date_format: how to change default time format in CGcalendar Template

Post by jcknight »

I am using CGCalendar for the first time, and the event template currently displays the time as
06:30:00 PM

But I would like to configure it to show as:
6:30 PM

Does anyone know where I could find or what the code would be, to change that format?



Thanks,
Jesse
milehigh

Re: cms_date_format: how to change default time format in CGcalendar Template

Post by milehigh »

Here's an example of the syntax needed:

{$event.event_date_start|cms_date_format:"%I:%M %p"}

Additional smarty date formatting details here..
http://www.smarty.net/manual/en/languag ... format.php
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

Re: cms_date_format: how to change default time format in

Post by wakewatcher »

Where is the template for this change? I found the 'sample' template which looks only to populate the table with links to (I guess) hidden pages. I've been searching around but I guess I don't know what I'm looking for. thx.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: cms_date_format: how to change default time format in

Post by Dr.CSS »

Most modules that have templates will have tabs for Summary, Detail, etc., templates and and one for all the default templates, they will sometimes be called Sample but they will be the templates used for the front end display of data, look in News for examples...
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

Re: cms_date_format: how to change default time format in

Post by wakewatcher »

yeah I found those but couldn't see where the suggested change would be made. The main display template just seems to iterate through the calendar and makes hyperlinks to the detail pages but I haven't run across the the templates for the detail pages which displays the time.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: cms_date_format: how to change default time format in

Post by paulbaker »

Go to Calguys Calendar -> Templates -> Event Templates tab. I just edit the one called Sample (you can always go back to the default template - they are available in the Default Templates tab). If it's a straightforward site you're unlikely to need more than one event template.

To make sure you've got the right template (it's not always obvious), put some temporary text in the template like "BOO!" and refresh the live site.....if you see your text you're editing the right thing. ;D
User avatar
wakewatcher
Forum Members
Forum Members
Posts: 149
Joined: Fri Dec 28, 2007 12:33 am

Re: cms_date_format: how to change default time format in

Post by wakewatcher »

Thanks! That did it.
Post Reply

Return to “Modules/Add-Ons”