Changelog 1.6
Release notes of @northguild/gmt 1.6.0, newest first, built from packages/gmt/CHANGELOG.md. Back to Changelog.
@burglekitt/gmt
Section titled “@burglekitt/gmt”
In memoriam: @burglekitt. These releases were published under the retired @burglekitt npm scope. The package continues as @northguild/gmt from 1.14.2; install @northguild/gmt.
Released 2026-08-08
Minor Changes
Section titled “Minor Changes”-
b7a9440: Adds
diffDateAsDuration,diffDateTimeAsDuration,diffZonedAsDuration,diffUnixAsDuration, anddiffUtcAsDuration— sibling functions to the existingdiffDate/diffDateTime/diffZoned/diffUnix/diffUtc, bridging to thedurationnamespace by returning an ISO 8601 duration string (e.g."P1DT2H") instead of a single-unit number.- Each takes a single
unit(not an array like its counterpart) to set the duration’slargestUnit— an ISO duration string already expresses a full multi-unit breakdown vialargestUnitalone. - Accepts the same
smallestUnit/roundingIncrement/roundingModerounding options as its counterpart (controlling the underlying difference), plus newtoStringSmallestUnit/fractionalSecondDigits/toStringRoundingModeoptions controlling the precision of the rendered string itself (mirroringparseDuration’s options) — kept as separately-named keys since both option sets have collidingsmallestUnit/roundingModenames with different Temporal types. - Returns
""on invalid input, matching thedurationnamespace’s string sentinel convention (rather thannull, which its counterpart number-returning functions use).
This completes Story Group A (Duration) of the Luxon/react-aria parity roadmap.
- Each takes a single
-
ca0aca3: Adds
formatDurationto thedurationnamespace, rendering an ISO 8601 duration string as a human-readable, locale-aware string (e.g."P1DT2H30M"+"en-US"→"1 day, 2 hours, and 30 minutes").- Built on
Intl.NumberFormat({ style: "unit" })for per-locale unit labels and pluralization, joined viaIntl.ListFormat— both universally available on Node 20/22/24 with no version variance, unlikeIntl.DurationFormat, which is absent entirely on Node 20/22 (only ships natively on Node 24+). This keepsformatDurationfree of any new runtime dependency, at the cost of not being a byte-for-byte match to nativeIntl.DurationFormatoutput (e.g. no"digital"style). - Accepts an optional
locale(system default if omitted) and{ style?: "long" | "short" | "narrow", zero?: boolean }options. - Zero-valued components are omitted by default; pass
{ zero: true }to include them. A zero-length duration ("PT0S") always renders"0 seconds". - Negative durations render each component with its own leading
"-". - Returns
""on invalid input: non-string value or invalid duration string.
- Built on
-
472df37: Adds
addDurationandsubtractDurationto thedurationnamespace, combining two ISO 8601 duration strings (e.g."P1D"+"PT2H"→"P1DT2H") viaTemporal.Duration.prototype.add/.subtract.Both operate on day/time units only — combining a pair where either operand has a nonzero years/months/weeks component returns
"", sinceTemporal.Duration.prototype.add/.subtracthave norelativeTooption to resolve calendar-unit arithmetic. -
b5c57aa: Adds
normalizeDurationto thedurationnamespace, rolling an ISO 8601 duration string’s small units into larger ones viaTemporal.Duration.prototype.round(e.g."PT90M"+{ largestUnit: "hour" }→"PT1H30M").- Defaults to
{ largestUnit: "auto" }when no options are given, which reformats a day/time-only duration without promoting units — pass an explicitlargestUnitto promote. - Accepts
largestUnit,smallestUnit,roundingIncrement,roundingMode, andrelativeTooptions, mirroringTemporal.Duration.prototype.round’s options. relativeTois required whenever a calendar unit (year/month/week) is involved — either as the requestedlargestUnit, or because the input duration already has a nonzero year/month/week component (this applies even under the"auto"default). Without it in either case, returns"".- Returns
""on invalid input: non-string value, invalid duration string, or invalidrelativeTo.
Also expands
addDuration/subtractDuration’s test coverage with additional permutations (overflow-without-borrow, negative-operand cancellation, fractional-second combination, negative-result subtraction) percontext/testing-standards/index.md’s exhaustiveit.eachcoverage bar. - Defaults to
-
a4b37f9: Adds a new
durationnamespace for parsing and validating ISO 8601 duration strings:isValidDuration— validates an ISO 8601 duration string (e.g."P1DT2H30M") viaTemporal.Duration.from.parseDuration— parses and re-normalizes an ISO 8601 duration string, returning""on invalid input. AcceptssmallestUnit,fractionalSecondDigits, androundingModeoptions to control the precision/rounding of the output.
Also extends the existing
add*/subtract*/diff*functions across theplain,zoned,unix, andutcnamespaces (addDate,addDateTime,addTime,addUnix,addUtc,addZoned, and theirsubtract/diffequivalents) with additional Temporal options that were previously unreachable:add*/subtract*gain anoverflowoption ("constrain"(default, matches current behavior) |"reject") controlling how an out-of-range arithmetic result (e.g. adding 1 month to Jan 31) is resolved — clamp to the nearest valid date, or reject and return the function’s sentinel (""/null).diff*gainsmallestUnit,roundingIncrement, androundingModeoptions to round the computed difference before it’s returned, instead of always returning the exact unrounded value.
All new options are optional and default to current behavior — no existing call signature changes.
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.