Forums / General / Calendar problem for 2 consecutive months

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

eZ debug

Timing: Jan 18 2025 04:55:52
Script start
Timing: Jan 18 2025 04:55:52
Module start 'content'
Timing: Jan 18 2025 04:55:52
Module end 'content'
Timing: Jan 18 2025 04:55:52
Script end

Main resources:

Total runtime0.1474 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.8359180.8203
Module start 'content' 0.00600.0077 768.656398.0234
Module end 'content' 0.01380.1335 866.6797529.3750
Script end 0.1473  1,396.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.6505200.0002
Check MTime0.00161.0556200.0001
Mysql Total
Database connection0.00070.474410.0007
Mysqli_queries0.101668.97651410.0007
Looping result0.00120.78761390.0000
Template Total0.133290.410.1332
Template load0.00110.714510.0011
Template processing0.132189.673410.1321
Override
Cache load0.00070.468910.0007
Sytem overhead
Fetch class attribute can translate value0.00070.454610.0007
XML
Image XML parsing0.00030.191410.0003
General
dbfile0.00634.3000200.0003
String conversion0.00000.003630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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