Custom end_date based on Sql value

Hi all,
There is the possibility of to do this?

In my lightbox I have build the possibility of setting types of appointments with predefinited time duration.
When I save a new event I want that the end_date value of event get the my predefinited time duration.
I use the connector.

Can you help me?

Thank You.

There are two ways to implement such use-case

a) create custom form section instead of “time”, which will have logic for automatic end-date setting

or

b) on server side, intercept beforeProcessing event and set correct value of end_date , based on other properties.

Hi Stanislav Thank You.
There is some example or doc for build an custom section time?

Which is the easy way for my goal? solution a) or solution b).

Thank you

I think (b) is more simple approach

docs.dhtmlx.com/doku.php?id=dhtm … foreupdate

Hi Stanislav, thank you very much.

I explain my goal.

I have a types of events with predefinited time duration.
Example, Coffe Break have a duration = 20 minutes, Tea Break = 30 minutes etc etc.
I want that this duration is SUM at start_date bypassing the my scheduler.config.time_step = 15;
When I save the event the end_date will be start_date + 30 minutes or 20 minutes etc etc.

Can you suggest some solution ? o the best way to do this?

Thank you.

Sondra

Something similar to next can be used

function custom_upd($action){
        $type = $action->get_value("type");
        $sdate = $action->get_value("start_date");
        $edate = $action->get_value("end_date");
        ... here you can change date in any necessary way
        $action->set_value("end_date", $edate);
}
$scheduler->event->attach("beforeProcessing", "custom_upd");

Hi Stanislav.
I have build the function for add my custom end_date with your suggestion code and work.
But I have a little problem.
When I setting and save in my lightbox the type of appointments with his duration time, in scheduler I view the default duration of the event. My setting is :

scheduler.config.time_step = 15;

And If I refresh the page the event duration is scheduler.config.time_step value + my_custom duration.
Can you help me ?
Thank You

Scheduler will modify end date only in next situation

  • during new event creation by dbl-click , or other way, where end date not provided - end date set as start date + time_step

  • if you have set end_date the same as start_date or lesser ( incorrect end time ) - end time will be set as start time + time_step

There must not be any other date modifications from scheduler’s logic.