Format [Uhr] for single dates

This commit is contained in:
Daniel Egger 2023-07-11 18:13:11 +02:00
parent 5890e908f2
commit ba7533614d
5 changed files with 10 additions and 9 deletions

View File

@ -1,10 +1,10 @@
<template>
<div>
<ul v-if="true">
<ul>
<li
v-for="dueDate in dueDatesDisplayed"
:key="dueDate.id"
:class="{ 'first:border-t': props.showTopBoarder, 'border-b': true }"
:class="{ 'first:border-t': props.showTopBorder, 'border-b': true }"
>
<DueDateSingle :due-date="dueDate"></DueDateSingle>
</li>
@ -26,7 +26,7 @@ import { computed } from "vue";
const props = defineProps<{
maxCount: number;
dueDates: DueDate[];
showTopBoarder: boolean;
showTopBorder: boolean;
}>();
const allDueDates = computed(() => {

View File

@ -3,7 +3,7 @@
<DueDatesList
:due-dates="allDueDates"
:max-count="props.maxCount"
:show-top-boarder="props.showTopBoarder"
:show-top-border="props.showTopBorder"
></DueDatesList>
</div>
</template>
@ -14,7 +14,7 @@ import { useCurrentCourseSession } from "@/composables";
const props = defineProps<{
maxCount: number;
showTopBoarder: boolean;
showTopBorder: boolean;
}>();
const courseSession = useCurrentCourseSession();

View File

@ -11,10 +11,10 @@ export const formatDate = (start: Dayjs, end: Dayjs) => {
}
if (!start || (!start.isValid() && end.isValid())) {
return `${endDateString} ${getTimeString(end)}`;
return `${endDateString} ${getTimeString(end)} ${end.format("[Uhr]")}`;
}
if (!end || (!end.isValid() && start.isValid())) {
return `${startDateString} ${getTimeString(start)}`;
return `${startDateString} ${getTimeString(start)} ${start.format("[Uhr]")}`;
}
// if start and end are on the same day, dont show the day twice
@ -23,6 +23,7 @@ export const formatDate = (start: Dayjs, end: Dayjs) => {
end
)} ${end.format("[Uhr]")}`;
}
return `${startDateString} ${getTimeString(start)} - ${endDateString} ${getTimeString(
end
)}`;

View File

@ -76,7 +76,7 @@ const getNextStepLink = (courseSession: CourseSession) => {
class="bg-white p-6"
:due-dates="allDueDates"
:max-count="10"
:show-top-boarder="false"
:show-top-border="false"
></DueDatesList>
</div>
</div>

View File

@ -95,7 +95,7 @@ const changeViewType = (viewType: ViewType) => {
<div class="text-bold pb-3">
{{ $t("learningPathPage.nextDueDates") }}
</div>
<DueDatesShortList :max-count="2" :show-top-boarder="true"></DueDatesShortList>
<DueDatesShortList :max-count="2" :show-top-border="true"></DueDatesShortList>
</div>
</div>