[SOLVED]CGCalender: month name shown on top is 1 month ahead

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

[SOLVED]CGCalender: month name shown on top is 1 month ahead

Post by staartmees »

The month name shown on top of a calendar or a list is 1 month ahead.
latest version of cmsms and modules, CGCalendar 1.14.1 and CGExtensions 1.38.11, php 5.3.28

http://www.tibetaans-instituut.org/cms/yeunten-ling-huy
Last edited by staartmees on Tue Jun 10, 2014 9:00 am, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: CGCalender: month name shown on top is 1 month ahead

Post by Rolf »

Try set in config.php

Code: Select all

$config['timezone'] = 'Europe/Amsterdam';
$config['set_db_timezone'] = 'Europe/Amsterdam';
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: CGCalender: month name shown on top is 1 month ahead

Post by paulbaker »

If Rolf's change doesn't work, post your CGCalendar template(s) for that page you linked.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: CGCalender: month name shown on top is 1 month ahead

Post by staartmees »

sorry Rolf, no change.

my template:

Code: Select all


<div class="calendar-list">
<div style="text-align:center;">
<h3>{if $day > 0}{$day} {/if}{$month_names[$month]} {$year}</h3>
{if isset($navigation)}
{if isset($navigation.prev)}<span class="calendar-prev"><a href="{$navigation.prev}">Vorige maand</a></span>{/if}&nbsp;&nbsp;-&nbsp;&nbsp;{if isset($navigation.next)}<span class="calendar-next"><a href={$navigation.next}">Volgende maand</a></span>{/if}
{/if}
<br />
</div>
<br /><br /><br />
{foreach from=$events key=key item=event}
  <div class="calendar-event">
<br /><br />
  <h3>{$event.event_title}</h3>
  {if $event.event_date_start == $event.event_date_end || $event.event_date_end == 0}
    <div class="calendar-date-from">{$event.event_date_start|date_format:"%A %e %B %Y"}</div>
  {else}
    {if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
      <div class="calendar-date-from">{$event.event_date_start|date_format:"%A %e %B %Y van %H:%M"} tot {$event.event_date_end|date_format:"%H:%M"}</div>
    {else}
      <div class="calendar-date-from">van {$event.event_date_start|date_format:"%A %e %B %Y %H:%M"} tot {$event.event_date_end|date_format:"%A %e %B %Y %H:%M"}</div>
    {/if}
  {/if}
  {if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" ||  $event.event_details == "<br />"))}
    <div class="calendar-summary"><span class="calendar-summary-title">{$lang.summary}: </span>{$event.event_summary}</div>
  {/if}
	{if $event.event_details !="" && $event.event_details != "<br />"}
		<div class="calendar-details">
<br /><br />
{$event.event_details|truncate:300:" ...":false}
<br /><br />
 >> <a href="{$event.url}">Lees verder </a> ...</div>
		{/if}
  </div>
<br clear="right">
<br /><br />
{/foreach}

{if $return_url != ""}
  <div class="calendar-returnlink">{$return_url}</div>
{/if}
</div>

<br /><br />
<div style="text-align:center;">
{if isset($navigation)}
{if isset($navigation.prev)}<span class="calendar-prev"><a href="{$navigation.prev}">Vorige maand</a></span>{/if}&nbsp;&nbsp;-&nbsp;&nbsp;{if isset($navigation.next)}<span class="calendar-next"><a href={$navigation.next}">Volgende maand</a></span>{/if}
{/if}
<br />
</div>

Same problem when I use a standard template

So the problem is located in the month navigation

Code: Select all

{$month_names[$month]}
I 'solved' the problem by changing

Code: Select all

{$month_names[$month]} into {$month_names[$month-1]} 
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: [SOLVED]CGCalender: month name shown on top is 1 month a

Post by Rolf »

I can confirm this at my site http://www.zeijen.nu/agenda. So looks like a bug, already reported it to Calguy.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: [SOLVED]CGCalender: month name shown on top is 1 month a

Post by paulbaker »

Here is bug report:
http://dev.cmsmadesimple.org/bug/view/10059

I'm getting this issue too now. CMSMS 1.11.10 & CGCalendar 1.14.3.

Templates have to be updated.

Smarty date format page shows %B as "full month name according to the current locale".

So you can drop the month_name stuff and replace with something like

Code: Select all

{$event.event_date_start|date_format:"%B"}
Looks like you still need month_name stuff in some templates (e.g. the main monthly view with next and previous links) where staartmees's solution works well.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: [SOLVED]CGCalender: month name shown on top is 1 month a

Post by Rolf »

Change

Code: Select all

{$month_names[$month]}
into

Code: Select all

{$date|date_format:'%B'}
grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Locked

Return to “Modules/Add-Ons”