feat(frontend): query component gebruiken bij CreateAssignment

This commit is contained in:
Joyelle Ndagijimana 2025-04-08 17:44:47 +02:00
parent 3758e7455f
commit 5d69ea9aa4
10 changed files with 370 additions and 339 deletions

View file

@ -1,51 +0,0 @@
<script setup lang="ts">
import { ref, computed, defineEmits } from "vue";
import {deadlineRules} from "@/utils/assignmentForm.ts";
const date = ref("");
const time = ref("23:59");
const emit = defineEmits(["update:deadline"]);
const formattedDeadline = computed(() => {
if (!date.value || !time.value) return "";
return `${date.value} ${time.value}`;
});
const updateDeadline = () => {
if (date.value && time.value) {
emit("update:deadline", formattedDeadline.value);
}
};
</script>
<template>
<div>
<v-card-text>
<v-text-field
v-model="date"
label="Select Deadline Date"
type="date"
variant="outlined"
density="compact"
:rules="deadlineRules"
required
@update:modelValue="updateDeadline"
></v-text-field>
</v-card-text>
<v-card-text>
<v-text-field
v-model="time"
label="Select Deadline Time"
type="time"
variant="outlined"
density="compact"
@update:modelValue="updateDeadline"
></v-text-field>
</v-card-text>
</div>
</template>
<style scoped>
</style>