vremel
Version:
JavaScript date utility library for Temporal API
9 lines • 610 B
TypeScript
import type { ArrayOf, Temporal } from "../types.js";
/**
* Returns an index of the closest datetime object to the given datetime object from the passed array.
* @param dateTimeToCompare the date to compare with
* @param dateTimes array of datetime objects
* @returns index of the closest datetime
*/
export declare function closestIndexTo<DateTime extends Temporal.Instant | Temporal.ZonedDateTime | Temporal.PlainDate | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.PlainYearMonth>(dateTimeToCompare: DateTime, dateTimes: ArrayOf<DateTime>): number;
//# sourceMappingURL=closestIndexTo.d.ts.map