-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Using updateLocale
with relativeTime
doesn't merge default local.
#3137
Comments
The actual issue here is that the code doesn't work on the This bug is actually a duplicate of #3121 that is manifesting in a different way. |
@maggiepint Thanks for the reply Maggie (and on a Saturday evening, no less)! :) I'll hang tight to see what the verdict is but based on some Stack Overflow Q&As, I think it would be a welcomed mod. |
Out of plain curiosity, where is that coming up on Stack Overflow? Matt and I watch the Moment tag pretty closely and we would have raised this issue if we saw it. |
Nothing major but I ran into this one: http://stackoverflow.com/questions/11448340/how-to-get-duration-in-weeks-with-moment-js |
@maggiepint you are right. If the whole system was based on the inheritance I added in the recent release it would work. But now its a bit of a mess still. |
Previously english locale was defined mostly in Locale.prototype. Now it's moved in locale config (similar to all other locales) that is merged the same way locales are patched (updated). Fixes moment#3137
Previously english locale was defined mostly in Locale.prototype. Now it's moved in locale config (similar to all other locales) that is merged the same way locales are patched (updated). Fixes moment#3137
Previously english locale was defined mostly in Locale.prototype. Now it's moved in locale config (similar to all other locales) that is merged the same way locales are patched (updated). Fixes moment#3137
I am using I am still not able to replace only one property of the Am I doing something wrong or this bug is still a bug? |
I don't think you do anything wrong. I have a similar experience.
So, there is definitely a bug here. |
For example, I just want to adjust a single
relativeTime
handler, like so:But this gives a
Cannot read property 'replace' of undefined
exception.My guess is that this isn't overriding just the
dd
object but instead it overrides the entirerelativeTime
object.You can get around this by providing all of the default locales, like so:
I can see from #2774 that there was an intention to use the default locale values and just update what you provide but I'm not sure if it made it as deep as the individual objects of
relativeTime
.Any feedback on this would be great. I'd be happy to write up a PR if this is of interest to anybody as well.
Thanks!
Josh
The text was updated successfully, but these errors were encountered: