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): stringclockText
function clockText(date: Date, use24Hours: boolean): stringcompensateMinute
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): numbertwoDigits
function twoDigits(value: number): stringzonedDate
function zonedDate(now: Date, timezone: ConfigValue | undefined): Date | null