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.