Add DueDatesFrontendComponents
This commit is contained in:
parent
b92ac8b08a
commit
639683c06d
|
|
@ -1,26 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="p-1">
|
||||||
<ul>
|
|
||||||
<li v-for="dueDate in dueDates" :key="dueDate.id">
|
|
||||||
<div class="m-3 p-1">
|
|
||||||
<p class="text-bold">{{ dueDate.title }}</p>
|
<p class="text-bold">{{ dueDate.title }}</p>
|
||||||
<div>{{ formatDate(dueDate.start, dueDate.end) }}</div>
|
<div>{{ formatDate(dueDate.start, dueDate.end) }}</div>
|
||||||
<a :href="dueDate.url" target="_blank">Details anschauen</a>
|
<a :href="dueDate.url" target="_blank">Details anschauen</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useCurrentCourseSession } from "@/composables";
|
import type { DueDate } from "@/types";
|
||||||
|
import { defineProps } from "vue";
|
||||||
|
|
||||||
defineProps<{}>();
|
const props = defineProps<{
|
||||||
|
dueDate: DueDate;
|
||||||
|
}>();
|
||||||
|
|
||||||
const courseSession = useCurrentCourseSession();
|
console.log(props.dueDate);
|
||||||
console.log(courseSession.value);
|
|
||||||
|
|
||||||
const dueDates = courseSession.value.duedates;
|
|
||||||
|
|
||||||
const formatDate = (start_str, end_str) => {
|
const formatDate = (start_str, end_str) => {
|
||||||
const start = new Date(start_str);
|
const start = new Date(start_str);
|
||||||
|
|
@ -43,6 +37,10 @@ const get_time_string = (date) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_date_string = (date) => {
|
const get_date_string = (date) => {
|
||||||
return date.toLocaleDateString();
|
return date.toLocaleDateString([], {
|
||||||
|
day: "numeric",
|
||||||
|
month: "short",
|
||||||
|
year: "numeric",
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ul>
|
||||||
|
<li v-for="dueDate in dueDates" :key="dueDate.id">
|
||||||
|
<SingleDueDate :due-date="dueDate"></SingleDueDate>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import SingleDueDate from "@/components/dueDates/DueDateSingle.vue";
|
||||||
|
import { useCurrentCourseSession } from "@/composables";
|
||||||
|
import { defineProps } from "vue";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
maxCount: {
|
||||||
|
type: number;
|
||||||
|
default: 3;
|
||||||
|
};
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const courseSession = useCurrentCourseSession();
|
||||||
|
console.log(props.maxCount);
|
||||||
|
|
||||||
|
const dueDates = courseSession.value.duedates.slice(0, 3);
|
||||||
|
console.log(courseSession.value.duedates);
|
||||||
|
</script>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import LearningPathAppointmentsMock from "@/pages/learningPath/learningPathPage/LearningPathAppointmentsMock.vue";
|
import DueDatesShortList from "@/components/dueDates/DueDatesShortList.vue";
|
||||||
import LearningPathListView from "@/pages/learningPath/learningPathPage/LearningPathListView.vue";
|
import LearningPathListView from "@/pages/learningPath/learningPathPage/LearningPathListView.vue";
|
||||||
import LearningPathPathView from "@/pages/learningPath/learningPathPage/LearningPathPathView.vue";
|
import LearningPathPathView from "@/pages/learningPath/learningPathPage/LearningPathPathView.vue";
|
||||||
import CircleProgress from "@/pages/learningPath/learningPathPage/LearningPathProgress.vue";
|
import CircleProgress from "@/pages/learningPath/learningPathPage/LearningPathProgress.vue";
|
||||||
|
|
@ -92,7 +92,7 @@ const changeViewType = (viewType: ViewType) => {
|
||||||
|
|
||||||
<!-- Right -->
|
<!-- Right -->
|
||||||
<div v-if="!useMobileLayout" class="max-w-md">
|
<div v-if="!useMobileLayout" class="max-w-md">
|
||||||
<LearningPathAppointmentsMock></LearningPathAppointmentsMock>
|
<DueDatesShortList></DueDatesShortList>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue