Skip to content
Snippets Groups Projects
Commit 778eea81 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

Revert "Courseware: Datum bei Verlängerung von Aufgaben"

This reverts commit 226ce752.
parent 226ce752
No related branches found
No related tags found
No related merge requests found
<template>
<input :value="formattedDate" @input="onInput" type="date" :min="formattedMinDate" />
<input :value="formattedDate" @input="onInput" type="date" />
</template>
<script>
......@@ -8,18 +8,14 @@ const toISO8601 = (date) => date.toISOString();
const pad = (what, length = 2) => `00000000${what}`.substr(-length);
export default {
props: ['value', 'min'],
props: ['value'],
data: () => ({
date: new Date(),
submissionDate: new Date()
}),
computed: {
formattedDate() {
return `${this.date.getFullYear()}-${pad(this.date.getMonth() + 1)}-${pad(this.date.getDate())}`;
},
formattedMinDate() {
return `${this.submissionDate.getFullYear()}-${pad(this.submissionDate.getMonth() + 1)}-${pad(this.submissionDate.getDate())}`;
}
},
methods: {
onInput({ target }) {
......@@ -33,9 +29,6 @@ export default {
if (this.value) {
this.date = fromISO8601(this.value);
}
if (this.min) {
this.submissionDate = fromISO8601(this.min);
}
},
};
</script>
......@@ -50,8 +50,8 @@
<RenewalDialog
v-if="renewalTask"
:renewalDate="renewalDate"
:renewalState="renewalTask.attributes.renewal"
:submissionDate="renewalTask.attributes['submission-date']"
@update="updateRenewal"
@close="closeDialogs"
/>
......
......@@ -24,7 +24,7 @@
</label>
<label v-if="state === 'granted'">
{{ $gettext('neue Frist') }}
<DateInput v-model="date" class="size-l" :min="submissionDate" />
<DateInput v-model="date" class="size-l" />
</label>
</form>
</template>
......@@ -34,7 +34,7 @@
<script>
import DateInput from '../layouts/CoursewareDateInput.vue';
export default {
props: ['renewalState', 'submissionDate'],
props: ['renewalDate', 'renewalState'],
components: {
DateInput,
},
......@@ -44,7 +44,7 @@ export default {
}),
methods: {
resetLocalVars() {
this.date = this.submissionDate ?? null;
this.date = this.renewalDate ?? null;
this.state = this.renewalState;
},
updateRenewal() {
......@@ -64,7 +64,7 @@ export default {
this.resetLocalVars();
},
watch: {
submissionDate(newValue) {
renewalDate(newValue) {
if (newValue !== this.date) {
this.resetLocalVars();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment