Skip to content

Commit 6f3984d

Browse files
GVodyanovbackportbot[bot]
authored andcommitted
fix: free busy not updating date
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
1 parent c347345 commit 6f3984d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/mixins/EditorMixin.js

+2
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ export default {
587587
this.calendarObjectInstanceStore.changeStartDate({
588588
calendarObjectInstance: this.calendarObjectInstance,
589589
startDate,
590+
onlyTime: false,
591+
changeEndDate: false,
590592
})
591593
},
592594
/**

src/store/calendarObjectInstance.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -1529,26 +1529,26 @@ export default defineStore('calendarObjectInstance', {
15291529
calendarObjectInstance,
15301530
startDate,
15311531
onlyTime = false,
1532+
changeEndDate = true,
15321533
}) {
15331534
if (onlyTime) {
15341535
startDate.setFullYear(calendarObjectInstance.startDate.getFullYear(), calendarObjectInstance.startDate.getMonth(), calendarObjectInstance.startDate.getDate())
15351536
}
15361537

1537-
if (!onlyTime) {
1538-
startDate.setHours(calendarObjectInstance.startDate.getHours(), calendarObjectInstance.startDate.getMinutes(), calendarObjectInstance.startDate.getSeconds())
1539-
}
1540-
15411538
const difference = startDate.getTime() - calendarObjectInstance.startDate.getTime()
15421539
const endDate = new Date(calendarObjectInstance.endDate.getTime() + difference)
15431540

15441541
this.changeStartDateMutation({
15451542
calendarObjectInstance,
15461543
startDate,
15471544
})
1548-
this.changeEndDateMutation({
1549-
calendarObjectInstance,
1550-
endDate,
1551-
})
1545+
1546+
if (changeEndDate) {
1547+
this.changeEndDateMutation({
1548+
calendarObjectInstance,
1549+
endDate,
1550+
})
1551+
}
15521552
},
15531553

15541554
/**
@@ -1591,10 +1591,6 @@ export default defineStore('calendarObjectInstance', {
15911591
endDate.setFullYear(calendarObjectInstance.endDate.getFullYear(), calendarObjectInstance.endDate.getMonth(), calendarObjectInstance.endDate.getDate())
15921592
}
15931593

1594-
if (!onlyTime) {
1595-
endDate.setHours(calendarObjectInstance.endDate.getHours(), calendarObjectInstance.endDate.getMinutes(), calendarObjectInstance.endDate.getSeconds())
1596-
}
1597-
15981594
this.changeEndDateMutation({
15991595
calendarObjectInstance,
16001596
endDate,

0 commit comments

Comments
 (0)