Page 1 of 1

CGcalendar: No Name of Month Displayed

Posted: Sat Mar 08, 2014 9:15 am
by rovercar
All I have is << >> with no month named. Shows the correct calendar for the present month but does not indicate something like <<March 2014>>

Otherwise, calendar fully functional.

I could really use some help on this one, please.

Re: CGcalendar: No Name of Month Displayed

Posted: Sat Mar 08, 2014 10:37 am
by staartmees
do you use a standard template out of the box?
All CG-modules need php 5.3.x.
cmsms version?

Re: CGcalendar: No Name of Month Displayed

Posted: Sat Mar 08, 2014 12:00 pm
by chandra
Which language do you are using?

Re: CGcalendar: No Name of Month Displayed

Posted: Fri Apr 25, 2014 11:29 am
by fiddler
I, too, had problems with the CGCalendar not displaying the name of the month and I looked to the forum here yesterday for a solution, but found none after an exhaustive 2.5 hour search.

This morning I decided to compare the templates of the CGCalendar on my brand new site, with a CGCalendar on a site I had upgraded. The main calendar templates were DIFFERENT!

This is what is missing:
{$month_names[$month]}&nbsp;{$year}&nbsp;

The entire code - as it appears in my upgraded site before calling up the first row of the table is:

<table class="calendar" id="cal-calendar">
<caption class="calendar-month">
<span class="calendar-prev"><a href="{$navigation.prev}">&laquo;</a></span>&nbsp;{$month_names[$month]}&nbsp;{$year}
&nbsp;<span class="calendar-next"><a href="{$navigation.next}">&raquo;</a></span>
</caption>

Once I added the missing code, the name of the month now shows. Hope someone finds this useful.

Re: CGcalendar: No Name of Month Displayed

Posted: Tue May 06, 2014 5:29 pm
by rtrainer
fiddler wrote: This is what is missing:
{$month_names[$month]}&nbsp;{$year}&nbsp;
What file should I put this in?

Re: CGcalendar: No Name of Month Displayed

Posted: Tue May 06, 2014 7:27 pm
by fiddler
Open up your CG Calendar program in the CMS admin panel.
Over on the right, next to an image of a pair of scissors you'll see the link "Templates". The Calendar Templates tab has a Sample as default. Bring up that template (if that is the template you use as your main template) and add code on the 3rd/4th line accordingly.

Re: CGcalendar: No Name of Month Displayed

Posted: Tue May 06, 2014 11:40 pm
by rtrainer
Thank you, worked like a champ.

Re: CGcalendar: No Name of Month Displayed

Posted: Thu Sep 04, 2014 6:22 pm
by Dr.CSS

Re: CGcalendar: No Name of Month Displayed

Posted: Mon Sep 15, 2014 7:25 pm
by ivobaska
No this item cannot be closed yet as all these calendar templates seem to have this problem.
On my site "september" is not shown where it should be and "october" is shown as "november". And "november" is displayed where it indeed should be "november".
The solution given in this thread looks simple but for those who are not into programming like me it is not so obvious.

Quote from the module's changelog:
<p>The 1.14.x series stops using the hardcoded month and day names in the lang file and began using locale specified date names. If you are encountering an 'off by one' problem in the CGCalendar display templates you will want to fix up your frontend templates. Restoring frontend templates to factory defaults should solve the issue. Essentially, you should not use the {$month_names} or {$day_names} array (they are one based). And instead should use the {$event.event_date_start} and {$event.event_date_end} smarty variables, and the date_format modifier to format dates appropriately.</p>

To me this is not clear.
Can the author of this module give the right templates?

Thanks for a great module.

Re: CGcalendar: No Name of Month Displayed

Posted: Tue Sep 16, 2014 7:33 am
by velden
Actually it's all in that quote:

Use the system's locale to get month names: have a look at http://php.net/manual/en/function.strftime.php
%B is probably what you're looking for.

The developer gives you the right templates: 'Restoring frontend templates to factory defaults should solve the issue'
Create a new temporary template and look how it's done in there.