Skip to content
Snippets Groups Projects
Verified Commit 0ae44ed5 authored by Hangzhi Yu's avatar Hangzhi Yu Committed by Jonathan Weth
Browse files

Reset validation status after entering start/end datetimes in absence creation form

parent 69b592d3
No related branches found
No related tags found
1 merge request!446Resolve "Absence creation dialog doesn't handle min/max date times correctly"
Pipeline #194557 failed
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
:subjects="subjects" :subjects="subjects"
:documentation="item" :documentation="item"
:affected-query="lastQuery" :affected-query="lastQuery"
:value="(selectedParticipations[item.id] ??= [])" :value="selectedParticipations[item.id] ??= []"
@input="selectParticipation(item.id, $event)" @input="selectParticipation(item.id, $event)"
/> />
</template> </template>
...@@ -69,9 +69,7 @@ ...@@ -69,9 +69,7 @@
<DocumentationLoader /> <DocumentationLoader />
</template> </template>
</infinite-scrolling-date-sorted-c-r-u-d-iterator> </infinite-scrolling-date-sorted-c-r-u-d-iterator>
<absence-creation-dialog <absence-creation-dialog :absence-reasons="absenceReasons" />
:absence-reasons="absenceReasons"
/>
</div> </div>
</template> </template>
......
<template> <template>
<v-form @input="$emit('valid', $event)"> <v-form ref="form" @input="$emit('valid', $event)">
<v-container> <v-container>
<v-row> <v-row>
<div aria-required="true" class="full-width"> <div aria-required="true" class="full-width">
...@@ -148,17 +148,27 @@ export default { ...@@ -148,17 +148,27 @@ export default {
const parsedStart = DateTime.fromISO(startDate); const parsedStart = DateTime.fromISO(startDate);
const parsedEnd = DateTime.fromISO(this.endDate); const parsedEnd = DateTime.fromISO(this.endDate);
if (parsedStart >= parsedEnd) { if (parsedStart >= parsedEnd) {
this.$emit('end-date', parsedStart.plus({ minutes: 5 }).toISO({ suppressSeconds: true })); this.$emit(
"end-date",
parsedStart.plus({ minutes: 5 }).toISO({ suppressSeconds: true }),
);
} }
this.$emit('start-date', startDate); this.$emit("start-date", startDate);
this.$refs.form.resetValidation();
this.$refs.form.validate();
}, },
handleEndDate(endDate) { handleEndDate(endDate) {
const parsedStart = DateTime.fromISO(this.startDate); const parsedStart = DateTime.fromISO(this.startDate);
const parsedEnd = DateTime.fromISO(endDate); const parsedEnd = DateTime.fromISO(endDate);
if (parsedEnd <= parsedStart) { if (parsedEnd <= parsedStart) {
this.$emit('start-date', parsedEnd.minus({ minutes: 5 }).toISO({ suppressSeconds: true })); this.$emit(
"start-date",
parsedEnd.minus({ minutes: 5 }).toISO({ suppressSeconds: true }),
);
} }
this.$emit('end-date', endDate); this.$emit("end-date", endDate);
this.$refs.form.resetValidation();
this.$refs.form.validate();
}, },
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment