FEAT-1: Tiere list page — Gridify filters (Status/Geschlecht/Farbschlag), sort, paging + German strings
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
gerbil-manager-web/src/format/labels.ts
Normal file
19
gerbil-manager-web/src/format/labels.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/** German label helpers for enum values and lookups. */
|
||||
import { de } from '../strings/de'
|
||||
import type { Gender, GerbilStatus } from '../api/types'
|
||||
|
||||
export function genderLabel(gender: Gender): string {
|
||||
return de.pages.gerbils.genderLabels[gender]
|
||||
}
|
||||
|
||||
export function statusLabel(status: GerbilStatus): string {
|
||||
return de.pages.gerbils.statusLabels[status]
|
||||
}
|
||||
|
||||
/** Format an ISO date ("YYYY-MM-DD") as German "TT.MM.JJJJ"; null -> dash. */
|
||||
export function formatDate(iso: string | null | undefined): string {
|
||||
if (!iso) return '—'
|
||||
const [y, m, d] = iso.split('-')
|
||||
if (!y || !m || !d) return iso
|
||||
return `${d}.${m}.${y}`
|
||||
}
|
||||
Reference in New Issue
Block a user