Generates a dynamic copyright year range string.
The function clamps invalid or future values to the current year.
The initial year the copyright started. Defaults to the current year.
The formatted copyright year or year range (e.g., "2026" or "2024-2026").
// If the current year is 2026:copyrightYears(2024); // returns "2024-2026"copyrightYears(2026); // returns "2026"copyrightYears(2030); // returns "2026"copyrightYears(-1); // returns "2026"copyrightYears('invalid'); // returns "2026" Copy
// If the current year is 2026:copyrightYears(2024); // returns "2024-2026"copyrightYears(2026); // returns "2026"copyrightYears(2030); // returns "2026"copyrightYears(-1); // returns "2026"copyrightYears('invalid'); // returns "2026"
Generates a dynamic copyright year range string.
The function clamps invalid or future values to the current year.