/**
 * Compute the display name from start/end dates (used for the `name` field).
 * Uses a regular hyphen: "2025" or "2025-2026"
 */
export function nameFromDates(start: Date, end: Date): string {
    const y1 = start.getUTCFullYear();
    const y2 = end.getUTCFullYear();
    return y1 === y2 ? `${y1}` : `${y1}-${y2}`;
}

/**
 * Compute a formatted display label for UI presentation.
 * Uses an en-dash (–) for proper typography: "2026" or "2025–2026"
 */
export function displayLabelFromDates(start: Date | string, end: Date | string): string {
    const s = start instanceof Date ? start : new Date(start);
    const e = end instanceof Date ? end : new Date(end);
    const y1 = s.getUTCFullYear();
    const y2 = e.getUTCFullYear();
    return y1 === y2 ? `${y1}` : `${y1}\u2013${y2}`;
}
