Open MadjidSahki opened 5 years ago
@MadjidSahki To move a schedule by dragging and dropping it is to update the schedule. So we provide an event hook that is fired before updating.
https://github.com/nhn/toast-ui.react-calendar#event https://nhn.github.io/tui.calendar/latest/Calendar#event-beforeUpdateSchedule
...
componentDidMount() {
this.calendarInst = this.ref.current.getInstance();
}
onBeforeUpdateSchedule(event: IEventObject) {
var schedule = event.schedule;
var changes = event.changes;
console.log('beforeUpdateSchedule', event);
this.calendarInst.updateSchedule(schedule.id, schedule.calendarId, changes);
}
...
render() {
return (
<div>
<Calendar
height="900px"
onBeforeUpdateSchedule={this.onBeforeUpdateSchedule.bind(this)}
Version
"@toast-ui/react-calendar": "^1.0.4",
Test Environment
Chrome 77 , Win10
Current Behavior
I can select an event, and move it perfectly, but i can't drop it. Dragging work perfectly, but drop doesn't work.
Expected Behavior
Drag an event, and drop it where desired
I have another question, is it possible to set a default start date for the calendar ?
Thx