22 lines
478 B
JavaScript
22 lines
478 B
JavaScript
const TITLE_SEPARATOR = ' — ';
|
|
|
|
function normalizeTitlePart(value) {
|
|
return String(value ?? '').trim();
|
|
}
|
|
|
|
export function buildAcademicCalendarTitle({
|
|
specialtyCode,
|
|
specialtyProfileName,
|
|
studyFormName,
|
|
academicYearTitle
|
|
} = {}) {
|
|
const parts = [
|
|
specialtyCode,
|
|
specialtyProfileName,
|
|
studyFormName,
|
|
academicYearTitle
|
|
].map(normalizeTitlePart);
|
|
|
|
return parts.every(Boolean) ? parts.join(TITLE_SEPARATOR) : '';
|
|
}
|