Commands, settings, SDK functions, anything in the docs.

Reference

@ledable/sdk/time

Time zones, clocks and dates.

On this page

Generated from the types of the SDK. Import from @ledable/sdk/time; an editor shows the same declarations and comments as you type.

Functions

clockColor

function clockColor(value: ConfigValue | undefined, lightness: number): string

clockText

function clockText(date: Date, use24Hours: boolean): string

compensateMinute

Within the last four seconds of a minute, returns the next minute and a TTL that runs to the end of it, so a clock frame fetched just before the minute changes does not reach the panel already showing the old minute. Otherwise returns the time unchanged with a TTL to the next minute.

function compensateMinute(date: Date): { date: Date; ttlMs: number }

describeTimeDelta

function describeTimeDelta(deltaMs: number, maxUnits = 2, includeWeeks = true)

exchangeTimestamp

Convert an exchange's local trading time to an instant, including its seasonal offset.

function exchangeTimestamp(text: string, timezone: string): number

twoDigits

function twoDigits(value: number): string

zonedDate

function zonedDate(now: Date, timezone: ConfigValue | undefined): Date | null