Skip to content

fix: resolve #894 — Feature: add locale format string to localeData or somewhere else#3034

Open
tang-vu wants to merge 1 commit into
iamkun:devfrom
tang-vu:contribai/feat/add-longdateformat-method-to-localedata-
Open

fix: resolve #894 — Feature: add locale format string to localeData or somewhere else#3034
tang-vu wants to merge 1 commit into
iamkun:devfrom
tang-vu:contribai/feat/add-longdateformat-method-to-localedata-

Conversation

@tang-vu
Copy link
Copy Markdown

@tang-vu tang-vu commented Apr 4, 2026

Summary

fix: resolve #894 — Feature: add locale format string to localeData or somewhere else

Problem

Severity: Low | File: src/plugin/localeData/index.js

Currently, there is no public, documented way to retrieve the localized format strings (like 'L', 'LL', 'LT', etc.) for a specific locale without accessing internal properties like $locale().formats. This enhancement adds the longDateFormat method to the localeData plugin, providing a Moment.js-compatible API to retrieve these format strings. This is useful for UI components that need to know the date format pattern (e.g., 'MM/DD/YYYY') based on the user's current locale.

Solution

Update the localeData plugin to include the longDateFormat method in the object returned by dayjs().localeData() and dayjs.localeData().

Changes

  • src/plugin/localeData/index.js (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Generated by ContribAI v5.7.1

…Data or somewhere else

Fixes iamkun#894

Signed-off-by: Tang Vu <145498528+tang-vu@users.noreply.github.com>
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.

Feature: add locale format string to localeData or somewhere else

1 participant