I have event starts in this month ends in next month if i update progress for this month its calculating for this month only and not considering the next month
scheduler.templates.event_bar_text = (start, end, event) => {
let days = this.oMomentHelper.calculateDaysForCalendar(start, end);
return `
<div class=“saar_progress_text” style=“width:${event.tsk_progress}%;display:inline-block; background-color:${event?.progressColor};”" >
<div class="${draggableAndDisableClass}" style = "left:${event.tsk_progress}%; width: 5px; z-index:1111"></div>
<div class='saar-schd-tl-progress-text'>${event.text}</div>
`;
}
scheduler.event(schedulerContainer, “mousemove”, (e) => {
if (scheduler.getEvent(eventId)) {
if (!positionChanged && startPos !== e.pageX) {
positionChanged = true;
}
if (positionChanged) {
// let oEvent = scheduler.getEvent(eventId);
let taskData;
const eventLine = scheduler[‘$root’].querySelector(“.dhx_cal_event_line[data-event-id='” + eventId + “'”);
const eventLineXPos = eventLine.getBoundingClientRect().x;
const dragPos = Math.max(e.pageX - eventLineXPos, 0);
const fullWidth = eventLine.offsetWidth || 1;
const computedProgress = Math.min(dragPos, fullWidth) / fullWidth;
progress = Math.round(computedProgress * 100);
console.log(progress);
// if (this.typeSelectedValue != SchedulerCommonConstants.TASKS) {
// this.updateUimodelAndSave(oEvent.as_task_id, roundedProgress);
// }
// else {
// this.updateUimodelAndSave(oEvent.id);
// }
}
}
});
scheduler.event(schedulerContainer, ‘mouseup’, (e) => {
let oEvent = scheduler.getEvent(eventId);
if (positionChanged && this.typeSelectedValue == SchedulerCommonConstants.TASKS) {
oEvent.tsk_progress = progress;
this.scheduler.updateEvent(oEvent);
// this.updateUimodelAndSave(oEvent.as_task_id, progress);
}
eventId = null;
startPos = null;
progress = null;
positionChanged = false;
});
}