UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

21 lines (20 loc) 816 B
import { Temporal } from "@js-temporal/polyfill"; import type { FractionalDigit } from "../../types/index.js"; type EndOfTimeUnit = Temporal.TimeUnit | "day"; /** * Return the end of the specified time `unit` for a given ISO 8601 time string. * * - Returns "" for invalid inputs. * * @param value ISO 8601 time string * @param unit EndOfTimeUnit to specify the unit for the end * @param optionsArg optional: fractionalSecondDigits (number) * @returns ISO 8601 string representing the end of the specified unit, or "" on invalid input * * @example endOfTime("12:34:56", "hour") // "12:59:59.999999999" * @example endOfTime("invalid", "hour") // "" */ export declare function endOfTime(value: string, unit: EndOfTimeUnit, optionsArg?: { fractionalSecondDigits?: FractionalDigit; }): string; export {};