Hi.
In the default behaviour of dhtmlxScheduler, it seems that if end_date is set to any date previous to the start_date, then it’s automatically updated to start_date + 5 minutes, and I have no clue about the end_date the user actually selected.
I’d like to get the end_date filled by the user, so I can validate that the end_date is after start_date, warning the user if this is not the case. Is this possible?
Hello,
By default when you create new event by double click, the duration will be 5 min. You can change this value with time_step config:
docs.dhtmlx.com/scheduler/api__s … onfig.html
If you need to create event with another duration, it’s possible by using drag and drop.
Also you can opening the lightbox every time when creating event and set the duration manually.
scheduler.attachEvent("onEventCreated", function(id,e){
scheduler.showLightbox(id);
});
Thanks Polina, for the quick answer.
However, the 5 minutes step is not my problem. The problem is that the scheduler is overriding the end_date incorrectly entered by the user when it’s before start_date. I want to get the actual end_date entered by the user, so I can validate this behaviour and warn the user about his mistake.
Please, provide with the demo link, where the problem can be reproduced.
Ok, go to docs.dhtmlx.com/scheduler/sample … _init.html demo and, please, follow these steps:
- one click on the cirque du soleil’s event (for instance)
- click on the details icon (the one like a window)
- change the init time from 07:00 to something after 09:00 (the end time). For instance, change it to 10:00. Keep the end time as it is.
- In this moment, the lightbox shows 10:00 as the start time and 09:00 as the end time.
- If you click the save button, then the event is saved with 10:05 as the end time.
What I wanted to do is to get the end date that the user actually selected and validate them so that if it’s before the start date I’ll warn the user about the problem. I don’t want the user to inadvertently set some incorrect dates without its knowledge.