governance.parseDurationfunctionno test imports itfunction parseDuration(text: string): Result<number, string>The length in milliseconds of an ISO 8601 duration, or why the text is not one.
Durations and instants: ISO 8601 durations (P1D, PT1H, P1Y) as exact lengths, and the sum of an instant and a duration. A year is 365 days and a month 30, so that a cadence is the same on every runtime and in every month. Pure: nothing here reads the clock.
import { parseDuration } from "./time.ts";
parseDuration("P1W"); // { kind: "ok", value: 604800000 }governance.parseDurationfunctionno test imports itfunction parseDuration(text: string): Result<number, string>The length in milliseconds of an ISO 8601 duration, or why the text is not one.
governance.instantMsfunctionno test imports itfunction instantMs(text: string): number | undefinedAn instant as milliseconds since the epoch, or undefined where the text is not an ISO 8601 instant with a zone.
governance.addDurationfunctionno test imports itfunction addDuration(instant: string, duration: string): Result<string, string>The instant a duration after instant, as an ISO 8601 instant in UTC.
parseDurationfunctionfunction parseDuration(text: string): Result<number, string>The length in milliseconds of an ISO 8601 duration, or why the text is not one.
instantMsfunctionno test imports itfunction instantMs(text: string): number | undefinedAn instant as milliseconds since the epoch, or undefined where the text is not an ISO 8601 instant with a zone.
addDurationfunctionfunction addDuration(instant: string, duration: string): Result<string, string>The instant a duration after instant, as an ISO 8601 instant in UTC.