Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the updateLocale Plugin should merge config rather than replace it #2386

Open
lanmch opened this issue Jul 26, 2023 · 2 comments · May be fixed by #2558
Open

the updateLocale Plugin should merge config rather than replace it #2386

lanmch opened this issue Jul 26, 2023 · 2 comments · May be fixed by #2558

Comments

@lanmch
Copy link

lanmch commented Jul 26, 2023

Describe the bug
updateLocal Plugin set default Value

Expected behavior
the updateLocale Plugin should merge config rather than replace it
image

Information

  • Day.js Version 1.11.9
  • OS: mac
  • Browser chrome 100+
@lanmch
Copy link
Author

lanmch commented Jul 26, 2023

eg.
in moment, i try to updateLocale relative time, it will just replace the future key.
but in dayjs, i try to updateLocale relative time, it replace the whole object.

moment.updateLocale('zh-cn', {
    relativeTime: {
         future: '%s test in the future'
    }
})
dayjs.updateLocale('zh-cn', {
    relativeTime: {
         future: '%s test in the future'
    }
})

moment and dayjs
image
image

@iamkun
Copy link
Owner

iamkun commented Jul 27, 2023

nice catch, thanks. PR is welcome

@liuseen-l liuseen-l linked a pull request Jan 20, 2024 that will close this issue
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 a pull request may close this issue.

2 participants