Get end date problem in recurring events

hi all,

when i use recurring events, if i select recurring event (its not happening if not selected) on “onEventAdded” event i cant get end date correctly :S

scheduler.attachEvent(“onEventAdded”, function(event_id, event_object) {
s += "getMonth = " + event_object.end_date.getMonth();
s += "\r\n getDate = " + event_object.end_date.getDate();
s += "\r\n getHours = " + event_object.end_date.getHours();
s += "\r\n getMinutes = " + event_object.end_date.getMinutes();
s += "\r\n getSeconds = " + event_object.end_date.getSeconds();

            // Recursion
            var rec_type = event_object.rec_type;
            var pid =;
            var event_length = event_object.event_length;               

For recurring event end date will point to the time when last occurrence of event will finish
If you need to get the end date of first instance - you can use getRecDates api.

how to use that ?

if (ev.rec_type) end_date = scheduler.getRecDates([0].end_date

i used this code

if (event_object.rec_type) end_date = scheduler.getRecDates([0].end_date;

and get the error

Uncaught TypeError: Object # has no method ‘getRecDates’

Are you using scheduler 2.3 with recurring extension?
( 2.2 and earlier version has not such method )

my version is 2.1, so what should i to do it right ?

there is no public API with the same result in your version of dhtmlxScheduler
just update to the latest one