endOfTime
Signature
Section titled “Signature”endOfTime(value: string, unit: any, optionsArg?: { fractionalSecondDigits?: FractionalDigit; }): stringimport { endOfTime } from "@northguild/gmt/plain/calculate";Return the end of the specified time unit for a given ISO 8601 time string.
- Returns “” for invalid inputs.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO 8601 time string |
unit |
any |
EndOfTimeUnit to specify the unit for the end |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
fractionalSecondDigits? |
FractionalDigit |
— |
Returns
Section titled “Returns”ISO 8601 string representing the end of the specified unit, or “” on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”endOfTime("12:34:56", "hour") // "12:59:59.999999999"endOfTime("invalid", "hour") // ""