hide time if not needed

This commit is contained in:
Julian Krauser 2025-01-16 13:50:10 +01:00
parent 15431450ac
commit b7e5e9e7fa
3 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<header class="sticky top-0 h-fit"> <header class="sticky top-0 h-fit z-50">
<div <div
primary primary
class="h-24 min-h-fit w-full px-4 md:px-12 py-2.5 justify-between items-center gap-5 flex overflow-hidden" class="h-24 min-h-fit w-full px-4 md:px-12 py-2.5 justify-between items-center gap-5 flex overflow-hidden"

View file

@ -17,7 +17,7 @@
</span> </span>
{{ data?.title }} {{ data?.title }}
</h1> </h1>
<p v-if="numberOverwrite != undefined" class="w-full text-[#5c5c5c]"> <p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
{{ {{
new Date(data?.date ?? "").toLocaleString("de-DE", { new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit", day: "2-digit",
@ -29,7 +29,7 @@
}} }}
Uhr Uhr
</p> </p>
<p v-else class="w-full text-[#5c5c5c]"> <p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
{{ {{
new Date(data?.date ?? "").toLocaleString("de-DE", { new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit", minute: "2-digit",

View file

@ -16,7 +16,7 @@
</h1> </h1>
<div class="grow shrink basis-0 flex-col justify-center items-center flex"> <div class="grow shrink basis-0 flex-col justify-center items-center flex">
<h1 class="w-full">{{ data?.title }}</h1> <h1 class="w-full">{{ data?.title }}</h1>
<p v-if="numberOverwrite != undefined" class="w-full text-[#5c5c5c]"> <p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
{{ {{
new Date(data?.date ?? "").toLocaleString("de-DE", { new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit", day: "2-digit",
@ -28,7 +28,7 @@
}} }}
Uhr Uhr
</p> </p>
<p v-else class="w-full text-[#5c5c5c]"> <p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
{{ {{
new Date(data?.date ?? "").toLocaleString("de-DE", { new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit", minute: "2-digit",