obligations-document, tom-document, loeschfristen-document, compliance-scope-triggers, sdk-flow/flow-data, processing-activities, loeschfristen-baseline-catalog, catalog-registry, dsfa mitigation-library + risk-catalog, vvt-baseline-catalog, vendor contract-review checklists + findings, demo-data, tom-compliance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
904 B
TypeScript
32 lines
904 B
TypeScript
// =============================================================================
|
|
// Obligations Document — Internal Helpers
|
|
// =============================================================================
|
|
|
|
export function escHtml(str: string): string {
|
|
return str
|
|
.replace(/&/g, '&')
|
|
.replace(/</g, '<')
|
|
.replace(/>/g, '>')
|
|
.replace(/"/g, '"')
|
|
}
|
|
|
|
export function formatDateDE(dateStr: string | null | undefined): string {
|
|
if (!dateStr) return '—'
|
|
try {
|
|
const date = new Date(dateStr)
|
|
if (isNaN(date.getTime())) return '—'
|
|
return date.toLocaleDateString('de-DE', {
|
|
day: '2-digit',
|
|
month: '2-digit',
|
|
year: 'numeric',
|
|
})
|
|
} catch {
|
|
return '—'
|
|
}
|
|
}
|
|
|
|
export function daysBetween(earlier: Date, later: Date): number {
|
|
const diffMs = later.getTime() - earlier.getTime()
|
|
return Math.floor(diffMs / (1000 * 60 * 60 * 24))
|
|
}
|