I am using “dhtmlx-scheduler”: “^6.0.2” in my angular 14 application. I am using postgres DB to store the events and the frontend uses a java api for the CRUD operations. This is my code to update the recurring event.
-
What happens here is I am receiving same startdate and enddate in the console.error(‘update event’, data) print statement. whereas my event is originally scheduled with NO END DATE. It is supposed to be like thi s"9999-02-01 05:00:00.000000 +00:00".
-
Also the light box is not loaded with correct data. My event is scheduled for everyday but in the lightbox (wg=hile trying to edit), “monthly” is selected as default.
scheduler.attachEvent(‘onEventChanged’, async (id: string | number, data: any) => {
console.error(‘update event’, data)
//all modified occurrences must be deleted when you update a recurring series
if (data.rec_type && data.rec_type != “none”) {
this.http.deleteModifiedOccurrences(data.id).then(resp => {
console.log(“Delete all modified occurrences”)
});
}
const updateData: any = {
id: data.id,
startDate: moment.utc(moment(data.start_date)).format(‘YYYY-MM-DDTHH:mm:ss[Z]’),
endDate: moment.utc(moment(data.end_date)).format(‘YYYY-MM-DDTHH:mm:ss[Z]’),
text: data.text,
name: data.name,
login: this.loginId,
eventPid: data.event_pid || 0,
eventLength: data.event_length || 0,
recType: data.rec_pattern || ‘’,
eventColor: data.priority == ‘1’ ? ‘#EE8E97’ : (data.priority == ‘2’ ? ‘#92E0A3’ : ‘#E0AE8F’),
}
await this.http.updateEvent(updateData);
window.location.reload();
}, null);