Skip to content

Documentation / @ripl/charts / formatTimeLabel

Function: formatTimeLabel() ​

formatTimeLabel(value, spanMs): string

Defined in: charts/src/core/options.ts:723

Formats a time-axis tick for display, adapting the format to the domain span; multi-year spans show the year, month-scale spans show abbreviated month and year, day-scale spans show dates, and anything shorter shows times. An explicit axis format always wins over this default.

Parameters ​

ParameterTypeDescription
valueDateThe tick's date value.
spanMsnumberThe axis domain span in milliseconds.

Returns ​

string

The formatted label.