Hello,
I am trying to copy and paste an event, using key_nav.
It is working fine, I managed to save events in my DB. However, when pasting an event, the starting date shown on the scheduler is always “00:00”.
When I open the LightBox for this event, correct values are displayed.
If I refresh the scheduler, the starting date shown on the scheduler is correct.
I attached a screenshot; the right event is a copy of the left one. But as you can see, dates aren’t the same.
Is there a way to get the correct starting date displayed ?
By default the start_date for new event is set according to cursor position when event is created. There is no hour scale in the month view, so the start time is set automatically to 00:00.
To solve the issue, you can save start/end time of copied event by “onClick” and set these values to new event by “onEventAdded”. Please, check the demo: docs.dhtmlx.com/scheduler/snippet/3d08bc55
This condition for check the view mode, while you copy an event.
key
In this case you can create only 1 copy of event with the same start_ and end_ dates. If you need to create more - remove it and use only:
if(scheduler.getState().mode==‘month’){ … }