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

Author Message

K259

Tuesday 06 September 2005 3:17:47 pm

I'm not sure how to achieve this with the agenda-code from contribution..

 <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, 0 ) )}
    <tr>
    {/section}
    {section show=and( $span1|gt( 0 ), eq( $number, 1 ) )}
      <td colspan="{$span1}" class="agenda"></td>
    {/section}
        {let    my_ts=makedate( $month, $number, $year )
                events=fetch( 'content', 'list_count', hash('parent_node_id',2469,depth,4,
                        'attribute_filter',
                        array( 'and',
                                array( 'agenda/fra_dato', '<=', $my_ts ),
                                array( 'agenda/til_dato', '>=', $my_ts )
) ) ) }
    {section show=eq( $number, $today )}
      <td headers="{concat( "d", $dayofweek)}" style="background-color:#ffffff;" class="agenda" width=7>
    {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/line/2469/day/", $item, "/month/", $month, "/year/", $year)|ezurl}>
    {/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, 6 ), eq( $number, $days ) )}
    </tr>
    {/section}
  {/let}{* dayofweek *}

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 :)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 07:38:19
Script start
Timing: Jan 31 2025 07:38:19
Module start 'layout'
Timing: Jan 31 2025 07:38:19
Module start 'content'
Timing: Jan 31 2025 07:38:19
Module end 'content'
Timing: Jan 31 2025 07:38:19
Script end

Main resources:

Total runtime0.0178 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.3906151.2422
Module start 'layout' 0.00700.0031 739.632836.7109
Module start 'content' 0.01000.0061 776.343894.2500
Module end 'content' 0.01610.0017 870.593833.9922
Script end 0.0178  904.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.2263140.0002
Check MTime0.00105.8282140.0001
Mysql Total
Database connection0.00095.297610.0009
Mysqli_queries0.004424.927230.0015
Looping result0.00000.068210.0000
Template Total0.00126.910.0012
Template load0.00095.173310.0009
Template processing0.00031.675910.0003
Override
Cache load0.00063.593710.0006
General
dbfile0.002715.235380.0003
String conversion0.00000.028140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs