How to get current start_date onBeforeLightbox

Hi

    How can i able to get  current start_date [b]onBeforeLightbox[/b] for recurring event(i.e clicked event date not recurring start_date)

Hi,
“onBeforeLightbox” receives the ID of the event as parameter, so you can use:

scheduler.getEvent(id).start_date

to get the start date of the series or an occurrence (depending on the button clicked - “Edit series” or “Edit occurrence”).

HI

Actually i am checking, if current date and time over i am using 

"onBeforeEventChanged "

                           scheduler.clearAll();
		           scheduler.load("path/connector.php");
		           scheduler.render_view_data(); 
                               scheduler.update_view();
		           return true;

I am getting error in console
TypeError: b is undefined
b.rec_type && this._lightbox_id && this._roll_back_dates(b);

Hmm,
it’s a quite unusual set of methods for “onBeforeEventChanged” event. When you clear all events from the scheduler it can not perform all internal operations with the event, it causes errors. What do you need to do if current date and time is over ?

Also, the API was designed to use public methods to work with the component
docs.dhtmlx.com/scheduler/api__r … ml#methods
It’s better to avoid to use internal methods like “scheduler.render_view_data(), scheduler.update_view()”, etc.

Hi

“What do you need to do if current date and time is over ?”

I dont want open light box if current time over and draging should not allow,and editing time before current date time should not allow to save.

Hi,
you can return “false” and all drag changes will be cancelled:

scheduler.attachEvent("onBeforeEventChanged", function(ev, e, is_new){ if (current time over) // you condition check the time return false; // the lightbox will not pop up, the changes will be cancelled else return true; });
docs.dhtmlx.com/scheduler/api__s … event.html