scheduler.getEvents(start_date,end_date) problem ?

Hello
As per http://forum.dhtmlx.com/viewtopic.php?f=6&t=36983&p=114590&hilit=getEvents#p114590 link suggest, i used like wise.

Problem :-
one recurring event is created , suppose i dragged a single event.
the scheduler.getEvents(start_date,end_date) reurns two records for that date .
i know when recurring event is dragged one new record is inserted .
But how should i distinguish.

  • recurring event.
  • recurring event and single update.
  • simple event.

in database one new record is inserted .

getEvents returns all event instances for the defined block of time, it may differ from count of record in DB. For example if you have a recurring event which occurs each day, this will be stored as a single record in DB, but if you will use getEvents for this month - it will return 30 instances, one for each event occurence.

So, when you are using getEvents you need not distinguish recurring and normal events, but process result always as those are normal events.

In common case, you can distinguish recurring and normal events through event_pid property ( it presents only on recurring events )

Hello Stanislav,
Thnks for ur response.

But i’m talking about dragged event. means one recurring is created on 23jul14 8:57 as start_time and i dragged to 23jul14 10:00 . then getEvents(start_date,end_date) returns two records for that date.

actually there is a single event . but returning two records for that date.
plz look following array.

1 - {“start_date”:“2014-07-25T03:35:00.000Z”,“end_date”:“2014-07-25T05:35:00.000Z”,“rec_type”:null,“rec_pattern”:null,“event_pid”:“4”,“event_length”:null,“text”:“New event”,“id”:“4#1406259300”,“hid”:“1”,“d_id”:“sc1323565,“p_id”:“1404”,”_timed":true}

2-{“id”:“5”,“start_date”:“2014-07-25T03:20:00.000Z”,“end_date”:“2014-07-25T05:20:00.000Z”,“text”:“New event”,“rec_type”:"",“event_pid”:“4”,“event_length”:“1406279100”,“hid”:“1”,“d_id”:“sc1334b7f60b23a0”,“p_id”:“1404”,“app_id”:“11”,“unit_id”:"",“created_by”:“sc1492688b7c833f”,“created_date”:“1406085798”,“modified_by”:"",“modified_date”:“0”,"_timed":true,"_pid_time":1406279100000,"_sday":4,"_inner":true,"_sorder":0,"_count":2}

In above output one of events is and instance of original recurring series, second the modified event in the series.

Do you see only one event of two events on the screen in this case ?

Hello Stanislav
thanks.
actually that event is dragged ,it should displayed one record.
when i called scheduler.getEvents(start_date,end_date) ,.
it displayed two records for that date.

Hi,
a just created “updated” record for this date will have the “event_length” property not “null” (a timestamp). The initial occurrence for this date will be deleted from pull when you release mouse button. So, for example, the method “scheduler.getEvents(start, end)” called from “onBeforeEventChanged” will return a correct number of the events.
docs.dhtmlx.com/scheduler/api__s … event.html