Add due date formatting to Attendance course
This commit is contained in:
parent
a7d17f7b69
commit
858541134e
|
|
@ -13,6 +13,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
dueDate: undefined,
|
||||
});
|
||||
|
||||
// TODO: Test if submission deadline is set correctly, and evaluation_deadline is set.
|
||||
|
||||
const step = useRouteQuery("step");
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div class="mb-12 grid grid-cols-icon-card gap-x-4 grid-areas-icon-card">
|
||||
<it-icon-calendar class="w-[60px] grid-in-icon" />
|
||||
<it-icon-calendar-light class="w-[60px] grid-in-icon" />
|
||||
<h2 class="text-large font-bold grid-in-title">Datum</h2>
|
||||
<p class="grid-in-value">{{ start }} - {{ end }}</p>
|
||||
<p class="grid-in-value">{{ formatDate(start, end) }}</p>
|
||||
</div>
|
||||
<div class="mb-12 grid grid-cols-icon-card gap-x-4 grid-areas-icon-card">
|
||||
<it-icon-location class="w-[60px] grid-in-icon" />
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatDate } from "@/components/dueDates/dueDatesUtils";
|
||||
import type { CourseSessionAttendanceCourse } from "@/types";
|
||||
import dayjs from "dayjs";
|
||||
import LocalizedFormat from "dayjs/plugin/localizedFormat";
|
||||
|
|
@ -33,8 +34,8 @@ const props = defineProps<Props>();
|
|||
|
||||
dayjs.extend(LocalizedFormat);
|
||||
const format = "LLLL";
|
||||
const start = computed(() => dayjs(props.attendanceCourse.start).format(format));
|
||||
const end = computed(() => dayjs(props.attendanceCourse.end).format(format));
|
||||
const start = computed(() => dayjs(props.attendanceCourse.start));
|
||||
const end = computed(() => dayjs(props.attendanceCourse.end));
|
||||
const location = computed(() => props.attendanceCourse.location);
|
||||
const trainer = computed(() => props.attendanceCourse.trainer);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -239,9 +239,11 @@ export const useCourseSessionsStore = defineStore("courseSessions", () => {
|
|||
contentId?: number
|
||||
): CourseSessionAssignmentDetails | undefined {
|
||||
if (contentId && currentCourseSession.value) {
|
||||
return currentCourseSession.value.assignment_details_list.find(
|
||||
(assignmentDetails) => assignmentDetails.learningContentId === contentId
|
||||
);
|
||||
return [];
|
||||
// TODO: Commented out because DueDate replaced assignment_details_list, not shure if other iformation is needed
|
||||
// currentCourseSession.value.assignment_details_list.find(
|
||||
// (assignmentDetails) => assignmentDetails.learningContentId === contentId
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -418,6 +418,7 @@ export interface CourseSessionAttendanceCourse {
|
|||
end: string;
|
||||
location: string;
|
||||
trainer: string;
|
||||
due_date: DueDate;
|
||||
}
|
||||
|
||||
export interface CourseSessionAssignmentDetails {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@ from vbv_lernwelt.course.models import (
|
|||
CourseSession,
|
||||
)
|
||||
from vbv_lernwelt.course_session.models import CourseSessionAttendanceCourse
|
||||
from vbv_lernwelt.course_session.serializers import (
|
||||
CourseSessionAttendanceCourseSerializer,
|
||||
)
|
||||
from vbv_lernwelt.course_session.serializers import CourseSessionAttendanceCourseSerializer
|
||||
from vbv_lernwelt.duedate.models import DueDate
|
||||
from vbv_lernwelt.duedate.serializers import DueDateSerializer
|
||||
|
||||
|
|
@ -105,7 +103,7 @@ class CourseSessionSerializer(serializers.ModelSerializer):
|
|||
"end_date",
|
||||
"additional_json_data",
|
||||
"attendance_courses",
|
||||
"assignment_details_list",
|
||||
# "assignment_details_list",
|
||||
"learning_path_url",
|
||||
"cockpit_url",
|
||||
"competence_url",
|
||||
|
|
|
|||
Loading…
Reference in New Issue