Release 3.1.0
[3.1.0] - 2026-07-25
Added
- New / completed localizations (from the library-wide locale audit):
- Relative time now localized for Danish (
da), Norwegian Bokmål (nb, alsono), Norwegian Nynorsk (nn), Swedish (sv), and Icelandic (is) — previously allow-listed but unimplemented, so they rendered in English. - Compass-point abbreviations added for Inuktitut (
iu) and Traditional Chinese (zh-TW, was inheriting Simplified forms). - Traditional Chinese (
zh-TW) era names (西元前/西元) added (was inheriting Simplified 公元前/公元). - Localized AM/PM markers for 11 locales that previously held English
AM/PMplaceholders (de, nl, ru, uk, be, sr, he, hy, kk, uz, sw). - Inuktitut (
iu) time-zone full names (getFullNameIu, 143 zones) —iupreviously had abbreviations only and fell back to English for full time-zone names.
- Relative time now localized for Danish (
LocalDate"Shortly" (near-future label):RelativeTimeConfiggains ashortlyString, the future mirror ofrecentlyString.LocalDate.formatReadableRelativenow renders near-future dates withinnowThreshold(beyond "Tomorrow") as the fuzzy "Shortly" string, symmetric with "Recently" for the recent past.LocalTimeRelative Direction: NewRelativeDirection { Past, Present, Future, Nearest }enum and adirectionparameter onLocalTime.formatReadableRelativeto resolve the ambiguity of a date-less clock time across midnight (modelled on ICU'sRelativeDateTimeFormatter.Direction).- Calendar-anchored
LocalTimeoverload:LocalTime.formatReadableRelative(now: Instant, timeZone, …)resolves the time to a concrete occurrence relative to a dated anchor and can therefore render day labels such as "Yesterday"/"Today"/"Tomorrow".
Changed
LocalTimerelative default is nowRelativeDirection.Nearest:LocalTime.formatReadableRelativepreviously used a linear same-day subtraction; it now defaults to the nearest occurrence on a 24-hour clock. Output is unchanged for times within 12 hours on the same side ofnow, but differs for pairs more than 12 hours apart or crossing midnight (e.g.now = 23:00, this = 01:00is now "in 2 hours" instead of "22 hours ago"). PassRelativeDirection.Presentfor the previous behaviour.
Fixed
- Persian (
fa) money symbol placement:fahad no placement rule and fell to the prefix-no-space default; the currency symbol is now placed after the amount with a space ("1٬234 ﷼"), matching Persian convention. - Duration formatting fell back to English for 10 locales:
az,eu,hy,ka,kk,lt,lv,sq,uz, andiuhad complete localized duration unit data but were missing from the internalisDurationTagSupportedlist, sodurationFormatterFornever selected them and these locales rendered durations in English. Added to the list; they now use their own translations. - Indonesian / Malay / Swahili fell back to English:
id,ms, andswhad full localized relative-time configs but were missing from the internal supported-tag list, sorelativeTimeConfigFornever selected them and these locales rendered in English. Added to the allow-list; they now use their own translations. LocalDate"Recently" /nowThreshold:LocalDate.formatReadableRelativeevaluated itsnowThresholdwindow before the Today/Yesterday/Tomorrow labels, so a customnowThreshold >= 2days replaced "Yesterday"/"Tomorrow" with "Recently", and "Recently" could describe future dates. The specific day labels now always take precedence, and "Recently" applies only to past dates withinnowThresholdbeyond yesterday. Default behaviour is unchanged. Regression tests added.- Relative Style Selection:
Instant.formatReadableRelativeresolved the Today/Tomorrow/Yesterday config fromrelativeTimeStyleinside the date-units branch; it now uses a style-free day-label lookup so the wrong style cannot be selected there. Output is unchanged for current locales (these labels are style-invariant today); the style-invariance of the day labels is now guarded by a dedicated test, and tests cover date-only (relativeTimeStyle = None), time-only (relativeDateStyle = None), threshold boundaries, and day-boundary/timezone disagreement cases. - Documentation: Documented on
formatReadableRelativethat passing the receiver asnowcollapses the delta to zero and renders everything as "just now".
Full Changelog: v3.0.3...v3.1.0