v1.2.0: Formular-Redesign und Listen-Verbesserungen
- Eingabe: alle 5 Felder (Führung, Datum, Start, Ende, Besucher) in einer Zeile - Eingabe: Datum einmalig, Start- und Endzeit getrennt - Führungsarten: Kürzel werden nur in DB gespeichert, Anzeige als Klartext - Liste: Datum und Zeit getrennt in eigenen Spalten - Hintergrundfarbe #EEF4FF auf Login- und Passwort-Seite übertragen - Alle Inputfelder gleich hoch (text-sm durchgehend) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,15 +11,21 @@ interface Props {
|
||||
compact?: boolean;
|
||||
}
|
||||
|
||||
function formatDateTime(dt: string, short = false): string {
|
||||
const pad = (n: number) => String(n).padStart(2, '0');
|
||||
|
||||
function formatDate(dt: string, short = false): string {
|
||||
if (!dt) return '';
|
||||
const d = new Date(dt);
|
||||
if (isNaN(d.getTime())) return dt;
|
||||
if (short) {
|
||||
const pad = (n: number) => String(n).padStart(2, '0');
|
||||
return `${pad(d.getDate())}.${pad(d.getMonth() + 1)}. ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||
}
|
||||
return d.toLocaleString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||
if (short) return `${pad(d.getDate())}.${pad(d.getMonth() + 1)}.`;
|
||||
return `${pad(d.getDate())}.${pad(d.getMonth() + 1)}.${d.getFullYear()}`;
|
||||
}
|
||||
|
||||
function formatTime(dt: string): string {
|
||||
if (!dt) return '';
|
||||
const d = new Date(dt);
|
||||
if (isNaN(d.getTime())) return dt;
|
||||
return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||
}
|
||||
|
||||
export default function LogbuchList({ kuppel, refreshKey, onEdit, limit = 20, compact = false }: Props) {
|
||||
@@ -65,7 +71,8 @@ export default function LogbuchList({ kuppel, refreshKey, onEdit, limit = 20, co
|
||||
<table className="w-full border-collapse" style={{ fontSize: compact ? '0.75rem' : '0.875rem' }}>
|
||||
<thead>
|
||||
<tr className="bg-gray-100 text-left">
|
||||
<th className={`${head} whitespace-nowrap`}>Beginn</th>
|
||||
<th className={`${head} whitespace-nowrap`}>Datum</th>
|
||||
<th className={`${head} whitespace-nowrap`}>Start</th>
|
||||
<th className={`${head} whitespace-nowrap`}>Ende</th>
|
||||
<th className={head}>Art</th>
|
||||
<th className={`${head} text-center w-10`}>Bes.</th>
|
||||
@@ -78,8 +85,9 @@ export default function LogbuchList({ kuppel, refreshKey, onEdit, limit = 20, co
|
||||
<tbody>
|
||||
{entries.map((e) => (
|
||||
<tr key={e.ID} className="hover:bg-gray-50">
|
||||
<td className={`${cell} whitespace-nowrap`}>{formatDateTime(e.Beginn, compact)}</td>
|
||||
<td className={`${cell} whitespace-nowrap`}>{formatDateTime(e.Ende, compact)}</td>
|
||||
<td className={`${cell} whitespace-nowrap`}>{formatDate(e.Beginn, compact)}</td>
|
||||
<td className={`${cell} whitespace-nowrap`}>{formatTime(e.Beginn)}</td>
|
||||
<td className={`${cell} whitespace-nowrap`}>{formatTime(e.Ende)}</td>
|
||||
<td className={cell}>{e.ArtFuehrung}</td>
|
||||
<td className={`${cell} text-center`}>{e.Besucher || ''}</td>
|
||||
<td className={cell}>{e.BEOs || '—'}</td>
|
||||
|
||||
Reference in New Issue
Block a user