Skip to content

array-support

Imported from yugajs/extension/array-support.

const arraySupport: yuga.Extension<void>;

Adds arrays of wall-clock values as parsables, Day.js’s arraySupport plugin.

Years 0-99 stay as written ([50, 0, 1] is the year 50), Day.js reads them as 1950, the same as the Date constructor. A single value ([2024]) is January 1st of the year, the same as the string "2024".


const wallToEpoch: (wall, timeZone) => number;

The epoch milliseconds of the wall clock [year, month, date, hour, minute, second, millisecond] (overflowing values carry, month: 13 is January of the next year) in a time zone (undefined is the system’s), NaN when it is invalid. Used by object-support too.

The wall clock is normalized as the UTC fields of a Date, which reads years 0-99 as written with setUTCFullYear (the constructor and Date.UTC read them as 19xx), then moved to the time zone keeping it, which knows its offsets and gaps.

Parameter Type
wall readonly number[]
timeZone string | undefined

number