Page 1 of 1

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

Posted: Mon Jun 09, 2014 4:20 pm
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

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

Posted: Mon Jun 09, 2014 7:05 pm
by Rolf
Try set in config.php

Code: Select all

$config['timezone'] = 'Europe/Amsterdam';
$config['set_db_timezone'] = 'Europe/Amsterdam';

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

Posted: Mon Jun 09, 2014 9:42 pm
by paulbaker
If Rolf's change doesn't work, post your CGCalendar template(s) for that page you linked.

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

Posted: Tue Jun 10, 2014 6:19 am
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]} 

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

Posted: Tue Jun 17, 2014 11:09 am
by Rolf
I can confirm this at my site http://www.zeijen.nu/agenda. So looks like a bug, already reported it to Calguy.

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

Posted: Fri Jun 27, 2014 10:10 pm
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.

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

Posted: Wed Jul 02, 2014 4:59 pm
by Rolf
Change

Code: Select all

{$month_names[$month]}
into

Code: Select all

{$date|date_format:'%B'}
grtz. Rolf