feature(task-modal): added ability to edit timeblocks both on create and edit

This commit is contained in:
Matej Glasnák committed 2025-10-14 01:02:36 +02:00
1 parent 80d0e57351
commit 056b27b016
2 files changed
+133 -85

No files matched your search

@@ -27,7 +27,6 @@
<v-text-field
:value="timeblock.starts_at_time"
@input="updateStartTime"
@focus="onInputFocus"
:class="{ error: v$?.timeblock.starts_at_time.$errors.length }"
type="time"
variant="solo"
@@ -37,7 +36,6 @@
<v-text-field
:value="timeblock.ends_at_time"
@input="updateEndTime"
@focus="onInputFocus"
:class="{ error: v$?.timeblock.ends_at_time.$errors.length }"
type="time"
variant="solo"
@@ -109,20 +107,20 @@ export default {
async openDatepicker(ref) {
this.$refs[ref].openMenu();
},
updateDate(date) {
const timeblock = { ...this.timeblock };
if (date) timeblock.date = date;
this.$emit('updateTimeblock', timeblock);
const updated = { ...this.timeblock, date };
this.$emit('updateTimeblock', updated);
},
updateStartTime(event) {
const timeblock = { ...this.timeblock };
timeblock.starts_at_time = event.target.value;
this.$emit('updateTimeblock', timeblock);
const updated = { ...this.timeblock, starts_at_time: event.target.value };
this.$emit('updateTimeblock', updated);
},
updateEndTime(event) {
const timeblock = { ...this.timeblock };
timeblock.ends_at_time = event.target.value;
this.$emit('updateTimeblock', timeblock);
const updated = { ...this.timeblock, ends_at_time: event.target.value };
this.$emit('updateTimeblock', updated);
},
},
};
@@ -158,4 +156,3 @@ export default {
width: 100% !important
pointer-events: none
</style>
e