View as Markdown

API reference: @salmonui/charts/range-selector

periodRangefunction

import { periodRange } from '@salmonui/charts/range-selector';
function periodRange(period: Period, end: number, min: number, timeZone?: string): [
    number,
    number
];

The [start, end] a period selects for data ending at end and starting at min (epoch ms or numbers). ytd starts on January 1 of the end's year in timeZone; the result never starts before min.