Page 1 of 1

CGkalender, yearlist + month

Posted: Sun Feb 28, 2010 2:03 pm
by bullitshot
hello!

I've been using CGkalender and in special the "yearlist". It created a list of all the events of a particular year. this is like:

2 march, .....

5 april, ........

27 april, .....

6 june, .......


But what I want is this:

MARCH

2 march, ....

APRIL

5 april, .......

27 april, .......

JUNE

etc.

How can you do that? I've been trying a lot of stuff but i can't get it to work

Re: CGkalender, yearlist + month

Posted: Sun Feb 28, 2010 3:48 pm
by Peciura
Edit appropriate CGCalendar list template as follows:
{assign var='prev_month_number' value=''}


...

{if $day > 0}{$day} {/if}{$month_names[$month]} {$year}
{foreach from=$events key=key item=event}
{assign var=month_number value=$event.event_date_start|date_format:"%m"} {*this line is simply moved a bit up*}
{if $month_number!=$prev_month_number}
{assign var='prev_month_number' value=$month_number}
{$month_names[$prev_month_number]|upper}
{/if}

 
  {$event.event_title}

...

Re: CGkalender, yearlist + month

Posted: Sun Feb 28, 2010 4:05 pm
by bullitshot
Thank you! very helpfull :)

Re: CGkalender, yearlist + month

Posted: Sun Feb 28, 2010 5:16 pm
by Peciura
If it works for you don't forget to add "[SOLVED] " tp subject of your first post.