You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/frontend/src/Season/formatSeason.ts

20 lines
432 B

import padNumber from 'Utilities/Number/padNumber';
import translate from 'Utilities/String/translate';
export default function formatSeason(
seasonNumber: number,
shortFormat?: boolean
) {
if (seasonNumber === 0) {
return translate('Specials');
}
if (seasonNumber > 0) {
return shortFormat
? `S${padNumber(seasonNumber, 2)}`
: translate('SeasonNumberToken', { seasonNumber });
}
return null;
}