(year: number, formatStr?: string)
| 249 | * Formats a year according to the year format extracted from month_format. |
| 250 | */ |
| 251 | export function formatYear(year: number, formatStr?: string): string { |
| 252 | const {yearFormat} = extractFormats(formatStr); |
| 253 | const convertedFormat = convertFormatTokens(yearFormat); |
| 254 | return format(new Date(year, 0, 1), convertedFormat, { |
| 255 | locale: getUserLocale(), |
| 256 | }); |
| 257 | } |
| 258 | |
| 259 | /** |
| 260 | * Parses a year string and converts it to a full 4-digit year. |
no test coverage detected
searching dependent graphs…