Calendar problem for 2 consecutive months

Author Message

Christian BELLET

Friday 13 June 2008 8:46:45 am

Hello,
I noticed a problem in the EZ Calendar. The problem is due to the fetch function and the more precisely to the attribute_filter that only displays an event if

from_time OR to_time is during the current month display in the frontend.

{def    $events=fetch( 'content', 'list', hash(
            'parent_node_id', $event_node_id,
            'sort_by', array( 'attribute', true(), 'event/from_time'),
            'class_filter_type',  'include',
            'class_filter_array', array( 'event' ),
            'main_node_only', true(),
             'attribute_filter',
            array( 'or',
                    array( 'event/from_time', 'between', array( sum($first_ts,1), sub($last_ts,1)  )),
                    array( 'event/to_time', 'between', array( sum($first_ts,1), sub($last_ts,1) )) )
                ))

    $url_reload=concat( $event_node.url_alias, "/(day)/", $temp_today, "/(month)/", $temp_month, "/(year)/", $temp_year, "/offset/2")
    $url_back=concat( $event_node.url_alias,  "/(month)/", sub($temp_month, 1), "/(year)/", $temp_year)
    $url_forward=concat( $event_node.url_alias, "/(month)/", sum($temp_month, 1), "/(year)/", $temp_year)
}

where array( sum($first_ts,1) = 1st day of the month
and sub($last_ts,1) = first day of the next month

I tried this but it doesn't solve my problem

{def	$events=fetch( 'content', 'list', hash(
			'parent_node_id', $event_node,
			'sort_by', array( 'attribute', true(), 'event/from_time' ),
			'class_filter_type',  'include',
            'class_filter_array', array( 'event' ),
			'main_node_only', true(),
	 		'attribute_filter',
			array( 'and', array('event/from_time', '<', sum($first_ts,1)), array('event/to_time', '>', sub($last_ts,1)) )
				))
				
	$url_reload=concat("/content/view/full/", $event_node,"/day/",$temp_today,"/month/",$temp_month,"/year/",$temp_year, "/offset/2")
	$url_back=concat("/content/view/full/",  $event_node,  "/month/", sub($temp_month, 1), "/year/", $temp_year)
	$url_forward=concat("/content/view/full/",  $event_node, "/month/", sum($temp_month, 1), "/year/", $temp_year)
}

because it only displays what is missing in the first code and I can't mix AND + OR

Anyone as a working function so I can get a working calendar ?

Thanks

Christian

André R.

Friday 13 June 2008 3:20:25 pm

Yes the calendar doesn't currently support events that last more then 2 months.
I'm not entirely sure, but I think it's only solvable in a extended attribute filter.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Christian BELLET

Sunday 15 June 2008 11:30:13 pm

Thanks for the quick answer. I already looked at this possibility in the documentation but due to the lack of time in my project, i merged two arrays :)

Christian

Geert Lybaert

Thursday 27 November 2008 12:34:21 pm

Hi

Has someone found a solution for this problem?

I added an event (from october 24 - january 16) and only the days in october and january mention the event, while november and december are empty.

Thanks for any suggestion.

BR
Geert

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 18 2025 11:32:32
Script start
Timing: Jan 18 2025 11:32:32
Module start 'layout'
Timing: Jan 18 2025 11:32:32
Module start 'content'
Timing: Jan 18 2025 11:32:32
Module end 'content'
Timing: Jan 18 2025 11:32:32
Script end

Main resources:

Total runtime0.0176 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.0079 589.1719152.6406
Module start 'layout' 0.00790.0034 741.812539.4766
Module start 'content' 0.01130.0043 781.289193.4609
Module end 'content' 0.01570.0019 874.750034.3047
Script end 0.0176  909.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002513.9800140.0002
Check MTime0.00126.5368140.0001
Mysql Total
Database connection0.00137.206410.0013
Mysqli_queries0.004324.324930.0014
Looping result0.00000.142010.0000
Template Total0.00169.110.0016
Template load0.00084.460210.0008
Template processing0.00084.630710.0008
Override
Cache load0.00053.074910.0005
General
dbfile0.00031.459780.0000
String conversion0.00000.058240.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