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

View File

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

View File

@ -11,10 +11,10 @@ export const formatDate = (start: Dayjs, end: Dayjs) => {
} }
if (!start || (!start.isValid() && end.isValid())) { if (!start || (!start.isValid() && end.isValid())) {
return `${endDateString} ${getTimeString(end)}`; return `${endDateString} ${getTimeString(end)} ${end.format("[Uhr]")}`;
} }
if (!end || (!end.isValid() && start.isValid())) { 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 // 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
)} ${end.format("[Uhr]")}`; )} ${end.format("[Uhr]")}`;
} }
return `${startDateString} ${getTimeString(start)} - ${endDateString} ${getTimeString( return `${startDateString} ${getTimeString(start)} - ${endDateString} ${getTimeString(
end end
)}`; )}`;

View File

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

View File

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