fix:#15 linted format and typ fix

This commit is contained in:
masterelmar
2023-11-20 11:50:46 +01:00
parent e8e7c6149a
commit ab25df81c1
13 changed files with 219 additions and 137 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import {inject} from "vue";
import {Module} from "../model/module.ts";
import {Event} from "../model/event.ts";
import { inject } from "vue";
import { Module } from "../model/module.ts";
import { Event } from "../model/event.ts";
import moment from "moment-timezone";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -14,10 +14,10 @@ function formatTimestamp(timestampString: string): string {
const timestamp = moment(timestampString);
// Die Zeitzone auf "Europe/Berlin" setzen
const berlinTime = timestamp.tz('Europe/Berlin');
const berlinTime = timestamp.tz("Europe/Berlin");
// Das gewünschte Format für die Ausgabe festlegen
return berlinTime.format('DD.MM.YYYY HH:mm');
return berlinTime.format("DD.MM.YYYY HH:mm");
}
function sortModuleEventsByStart(events: Event[]) {
@@ -43,8 +43,14 @@ function sortModuleEventsByStart(events: Event[]) {
<tr>
<td>
<div class="card">
<DataTable :value="sortModuleEventsByStart(module.events)" table-style="min-width: 50rem">
<Column field="day" :header="$t('moduleInformation.day')"></Column>
<DataTable
:value="sortModuleEventsByStart(module.events)"
table-style="min-width: 50rem"
>
<Column
field="day"
:header="$t('moduleInformation.day')"
></Column>
<Column field="start" :header="$t('moduleInformation.start')">
<template #body="slotProps">
{{ formatTimestamp(slotProps.data.start) }}
@@ -52,12 +58,21 @@ function sortModuleEventsByStart(events: Event[]) {
</Column>
<Column field="end" :header="$t('moduleInformation.end')">
<template #body="slotProps">
{{formatTimestamp( slotProps.data.end) }}
{{ formatTimestamp(slotProps.data.end) }}
</template>
</Column>
<Column field="rooms" :header="$t('moduleInformation.room')"></Column>
<Column field="eventType" :header="$t('moduleInformation.type')"></Column>
<Column field="week" :header="$t('moduleInformation.week')"></Column>
<Column
field="rooms"
:header="$t('moduleInformation.room')"
></Column>
<Column
field="eventType"
:header="$t('moduleInformation.type')"
></Column>
<Column
field="week"
:header="$t('moduleInformation.week')"
></Column>
</DataTable>
</div>
</td>