Visitar URL original
[bugfix] Apply postformat to locale relative time methods by mattjohnsonpint · Pull Request #6448 · moment/moment · GitHub
Skip to content

[bugfix] Apply postformat to locale relative time methods - #6448

Merged
mattjohnsonpint merged 1 commit into
developfrom
mjp/fix-5935
Sep 14, 2026
Merged

mattjohnsonpint merged 1 commit into
developfrom
mjp/fix-5935

Conversation

@mattjohnsonpint

Copy link
Copy Markdown
Contributor

Summary

Apply locale postformat transformations to direct calls to:

  • Locale#relativeTime
  • Locale#pastFuture

Previously, postformat was only applied by higher-level APIs such as fromNow() and duration.humanize(). This caused direct locale method calls to return untransformed numbers for locales with symbol maps.

The internal relative-time helpers remain unformatted so composed humanized output is still postformatted only once.

Fixes #5935.

Tests

Added coverage for:

  • Direct Locale#relativeTime postformatting
  • Direct Locale#pastFuture postformatting
  • The exact Nepali reproduction from the issue

Validation:

  • pnpm test -- --only=moment/preparse_postformat
  • pnpm test -- --only=locale/ne
  • pnpm validate

@mattjohnsonpint
mattjohnsonpint requested a review from a team as a code owner September 14, 2026 15:06
@mattjohnsonpint
mattjohnsonpint merged commit 2c7abe1 into develop Sep 14, 2026
26 checks passed
@mattjohnsonpint
mattjohnsonpint deleted the mjp/fix-5935 branch September 14, 2026 15:08
@mattjohnsonpint mattjohnsonpint added this to the 2.31.0 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Locale postformat function not applied to relativeTime

1 participant