Share » Forums » Developer » Agenda..howto start calendar with...

Agenda..howto start calendar with Monday instead of Sunday??

Agenda..howto start calendar with Monday instead of Sunday??

Tuesday 06 September 2005 3:17:47 pm - 1 reply

Author Message

Eivind Marienborg

Wednesday 07 September 2005 12:38:09 am

    <tr>
{* display day names *}
{section loop=$dayarray}
      <th id="{concat("d", $index)}">{$item}</th>
{/section}
    </tr>
  </thead>
  <tbody>
{* main loop - loops days *}
{section loop=$days}
  {let dayofweek=makedate( $month, $number, $year )|datetime( custom, '%w' )}
    {section show=or( eq( $number, 1 ), eq( $dayofweek, 1 ) )}
    <tr>
    {/section}
    {section show=and( $span1|gt( 0 ), eq( $number, 1 ) )}
      <td colspan="{sub($span1,1)}" class="agenda"></td>
    {/section}
        {let    my_ts=makedate( $month, $number, $year )
                events=fetch( 'content', 'list_count', hash(
                        'parent_node_id', 126,
                        depth, 2,
                        'attribute_filter',
                        array( 'and',
                                array( 'aktiv/from_date', '<=', $my_ts ),
                                array( 'aktiv/to_date', '>=', $my_ts )
) ) ) }
    {section show=eq( $number, $today )}
      <td headers="{concat( "d", $dayofweek)}" class="activeagenda">
    {section-else}
      <td headers="{concat( "d", $dayofweek)}" class="agenda">
    {/section}
    {section show=$events|gt( 0 )}
        <span style="font-weight: bold;"><a href={concat("/content/view/full/29198/(day)/", $item, "/(month)/", $month, "/(year)/", $year)|ezurl}
title="Aktiviteter: {$events}">
    {/section}
{$number}
    {section show=$events|gt( 0 )}
        </a></span>
    {/section}
      {/let}{* fetch *}
      </td>
    {section show=and( eq( $number, $days ), $span2|gt( 0 ))}
      <td colspan="{$span2}" class="agenda"></td>
    {/section}
    {section show=or( eq( $dayofweek, 7 ), eq( $number, $days ) )}
    </tr>
    {/section}
  {/let}{* dayofweek *}

This is my hack for starting the calendar on Monday. I know it has some bugs, it messed up August, but I haven't had time to check it out..

Of course it also need adapting to your links etc :)

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu