[timeline] timeblocks jumping

This commit is contained in:
JakubPapso committed 2024-02-26 16:44:53 +01:00
1 parent 8521f5429b
commit f13afeb72e
1 file changed
+12 -12
@@ -211,23 +211,23 @@ export default {
async eventMoved({ event, newSplit }) { async eventMoved({ event, newSplit }) {
const date = addDays(this.calConfig.date, newSplit - 1) const date = addDays(this.calConfig.date, newSplit - 1)
const start = date.setHours(Math.round(event.startTimeMinutes / 60), Math.round(event.startTimeMinutes % 60), 0) const start = date.setHours(Math.floor(event.startTimeMinutes / 60), Math.round(event.startTimeMinutes % 60), 0)
const end = date.setHours(Math.round(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0) const end = date.setHours(Math.floor(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0)
const split = this.splits.find(split => split.id == newSplit ) const split = this.splits.find(split => split.id == newSplit )
if(this.$route.name == 'Dashboard - Tasks') { if(this.$route.name == 'Dashboard - Tasks') {
const editedSubtask = { const editedSubtask = {
...event.subtask, ...event.subtask,
timeblocks: [...event.subtask.timeblocks, { timeblocks: [...event.subtask.timeblocks, {
id: event._timeblock_id, id: event._timeblock_id,
is_finished: 0, is_finished: 0,
start: tmUtils.formatDateTimeForBackend(start), start: tmUtils.formatDateTimeForBackend(start),
end: tmUtils.formatDateTimeForBackend(end) end: tmUtils.formatDateTimeForBackend(end)
}], }],
timesheets: event.subtask.timesheets.map((timesheet) => { timesheets: event.subtask.timesheets.map((timesheet) => {
delete timesheet.employee_name delete timesheet.employee_name
return timesheet return timesheet
}) })
} }
try { try {