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

Function formatMonth

components/dash-core-components/src/utils/calendar/helpers.ts:187–197  ·  view source on GitHub ↗
(
    year: number,
    month: number,
    formatStr?: string
)

Source from the content-addressed store, hash-verified

185}
186
187export function formatMonth(
188 year: number,
189 month: number,
190 formatStr?: string
191): string {
192 const {monthFormat} = extractFormats(formatStr);
193 const convertedFormat = convertFormatTokens(monthFormat);
194 return format(new Date(year, month, 1), convertedFormat, {
195 locale: getUserLocale(),
196 });
197}
198
199/**
200 * Extracts separate month and year format strings from a combined month_format, e.g. "MMM YY".

Callers 1

helpers.test.tsFile · 0.90

Calls 3

extractFormatsFunction · 0.85
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…