MCPcopy Index your code
hub / github.com/plotly/dash / parseYear

Function parseYear

components/dash-core-components/src/utils/calendar/helpers.ts:264–273  ·  view source on GitHub ↗
(yearStr: string)

Source from the content-addressed store, hash-verified

262 * Example (when current year is 2025): 00-74 → 2000-2074, 75-99 → 1975-1999
263 */
264export function parseYear(yearStr: string): number | undefined {
265 const formats = ['yy', 'yyyy'];
266 for (const fmt of formats) {
267 const parsed = parse(yearStr.trim(), fmt, new Date());
268 if (isValid(parsed)) {
269 return parsed.getFullYear();
270 }
271 }
272 return undefined;
273}

Callers 2

CalendarComponentFunction · 0.90
helpers.test.tsFile · 0.90

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…