MCPcopy Create free account
hub / github.com/plotly/dash / dateAsStr

Function dateAsStr

components/dash-core-components/src/utils/calendar/helpers.ts:85–92  ·  view source on GitHub ↗
(
    date?: Date
)

Source from the content-addressed store, hash-verified

83 * Outputs a date object in YYYY-MM-DD format, suitable for use in props
84 */
85export function dateAsStr(
86 date?: Date
87): `${string}-${string}-${string}` | undefined {
88 if (!date) {
89 return undefined;
90 }
91 return formatDate(date, 'YYYY-MM-DD') as `${string}-${string}-${string}`;
92}
93
94export function strAsDate(
95 dateStr?: string,

Callers 3

DatePickerRangeFunction · 0.90
DatePickerSingleFunction · 0.90
helpers.test.tsFile · 0.90

Calls 1

formatDateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…