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

Function formatDate

components/dash-core-components/src/utils/calendar/helpers.ts:74–80  ·  view source on GitHub ↗
(date?: Date, formatStr = 'YYYY-MM-DD')

Source from the content-addressed store, hash-verified

72}
73
74export function formatDate(date?: Date, formatStr = 'YYYY-MM-DD'): string {
75 if (!date) {
76 return '';
77 }
78 const convertedFormat = convertFormatTokens(formatStr);
79 return format(date, convertedFormat, {locale: getUserLocale()});
80}
81
82/*
83 * Outputs a date object in YYYY-MM-DD format, suitable for use in props

Callers 5

CalendarMonthHeaderFunction · 0.90
DatePickerRangeFunction · 0.90
DatePickerSingleFunction · 0.90
helpers.test.tsFile · 0.90
dateAsStrFunction · 0.85

Calls 2

convertFormatTokensFunction · 0.85
getUserLocaleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…