[TYPO3-calendar] findAllWithin

Mario Matzulla mario at matzullas.de
Fri Jun 17 07:16:52 CEST 2011


Hi Peter,

Am 15.06.11 22:10, schrieb Peter Jame:
> Hi Mario,
>
> Am 15.06.2011 21:08, schrieb Mario Matzulla:
>> Hi Peter,
>>
>> Am 15.06.11 15:53, schrieb Peter Jame:
>>> Hi Mario,
>>>
>>> Am 10.06.2011 10:36, schrieb Mario Matzulla:
>>>
>>>> Am 09.06.11 01:39, schrieb Peter Jame:
>>>>> I can't get findAllWithin to work according to my needs. I'm extending
>>>>> yearview and trying to get events from lets say 20110501 until
>>>>> 20121101.
>>>>> I've been trying it this way:
>>>>>
>>>>> $type = $this->conf['type'];
>>>>> $pidList = $this->conf['pidList'];
>>>>> $getdate = $this->conf['getdate'];
>>>>> $eventType='0,1,2,3';
>>>>>
>>>>> $modelObj =&tx_cal_registry::Registry('basic','modelcontroller');
>>>>>
>>>>> $timeStartObj = new tx_cal_date('20110501'.'000000');
>>>>> $timeStartObj->setTZbyId('UTC');
>>>>>
>>>>> $timeEndObj = new tx_cal_date('20121101'.'000000');
>>>>> $timeEndObj->setTZbyId('UTC');
>>>>>
>>>>> $master_array = $modelObj->findAllWithin('cal_event_model',
>>>>> $timeStartObj, $timeEndObj, $type, 'event', $pidList, $eventType);
>>>>>
>>>>> $timeStartObj seems to have some (correct) effect, $timeEndObj doesn't
>>>>> at all.
>>>>>
>>>>> Hoping on a huge hint on what I'm doing wrong...
>>>>
>>>> for the different views we have a startPointCorrection and
>>>> endPointCorrection ->   to get full weeks.
>>>
>>> that means using the above code and setting
>>>
>>> plugin.tx_cal_controller.view.year.startPointCorrection = 0
>>> plugin.tx_cal_controller.view.year.endPointCorrection = 0
>>>
>>> $timeStartObj and $timeEndObj to lets say 20110520
>>>
>>> should return the events of exaktly that single day?
>>
>> no, it would return the events for the current year starting January 1st
>> and ending December 31st.
>
> So obviously I'm wrong on some point. The question remains the same:
> What would the solution look like? I mean: what on this code has to be
> changed to get the desired result?
>
>>>> But the question for me is: why don't you use the master_array given by
>>>> the current year view and "just" override the "view"?
>>>
>>> In fact I'm not using it, because I might need something completely
>>> different. For example exaktly from 20110501 until 20121101, which is
>>> not covered by master_array. At least when I'm ot wrong.
>>
>> Why don't you use the list view for such an issue?
>
> because it also, just as year view, does not solve the problem exaktly
> to my needs. Or is it possible to tell list view to display an exaktly
> defined period of time?

Of course:
view.list.starttime = 01.05.2011
view.list.endtime = 01.11.2012

Regards
Mario

>
> Thanks and regards
> Peter



More information about the TYPO3-project-calendar mailing list