Skip to content

0.9.71

Choose a tag to compare

@DirazCoder DirazCoder released this 16 Sep 16:59
· 7 commits to main since this release

temporal-fmt v0.9.71

Added

  • numberingSystem / parseNumberingSystem accept 'auto' — resolves
    whichever numeral system the call's own locale actually uses, via
    Intl.NumberFormat(locale).resolvedOptions().numberingSystem, instead of
    making the caller hardcode a system code per locale. { numberingSystem: 'auto', locale: 'ar-EG' } gets Arabic-Indic digits, bn-BD gets Bengali,
    en-US stays ASCII — same option, no per-locale branching in caller code.
    Works the same on the parse side, and through createConfig(): a config's
    numberingSystem: 'auto' resolves per call against whichever locale that
    call ends up using, so one shared config can drive different digits for
    different callers instead of pinning a single system. Default's still
    'latn', so if you're not passing the option, nothing about your existing
    calls changes. When a locale's native system isn't one this library can
    transliterate — Thai, Lao, Myanmar — 'auto' falls back to 'latn' rather
    than throwing; only a malformed locale tag throws.

Fixed

  • MMMM/MMM/EEEE/EEE (and stand-alone LLLL/cccc) rendered the
    wrong month or weekday for dates before October 15, 1582. Turns out ICU's
    gregory calendar applies a Julian cutover at that date — Intl.Date- TimeFormat was silently reinterpreting anything earlier under Julian
    rules, even though Temporal itself is proleptic Gregorian throughout.
    1500-07-05 would come back labeled "June," on the wrong weekday, because
    Julian ran about 10 days behind proleptic Gregorian by then. Numeric tokens
    were never affected — they don't touch Intl at all, only the name lookups
    did. Fixed by never handing Intl the historical date in the first place:
    the month/weekday number now comes straight off Temporal's own proleptic
    fields, then gets looked up against a safe modern reference date (the same
    ones the locale vocab already builds from, so format output still parses
    straight back). Non-Gregorian-calendar objects — Hebrew, Islamic — were
    never touched by the bug and aren't touched by the fix either; ICU doesn't
    apply this cutover to them, so that path was already correct.

Docs

  • README's "Known limitations" section is gone. Every item in it had
    already grown a fuller writeup somewhere else in the doc — this was just a
    stale summary duplicating them. Two of those sections picked up a line
    this changelog entry made newly relevant: the actual fix for ambiguous
    glued tokens is zero-padding or a separator, not just the lenient flag;
    and xxx is the one offset token that can carry a sub-minute historical
    offset (Europe/London pre-1847) through verbatim, where the other five
    throw.