Open geroyche opened 7 years ago
It seems like only the second parameter to locale
was deprecated (i.e. customizing strings). Can you please send a PR that will call updateLocale
if the second parameter is provided?
Thanks!
not only so. it's also about whether the locale already exists or not.
.locale(locale) to simply load an existing locale .locale(locale, opt) to load a newly created one .updateLocale(locale, opt) to load an existing locale and customize
maybe it would be best to additionally provide .locale() and updateLocale() to your directive? that way existing code will continue to work, and in new code users can decide what to call, based on their knowledge about whether a locale exists already or not.
Yes, that makes sense. I think that the best solution would be to deprecate the second parameter to changeLocale
. If you want to define a new locale, or update an existing one - just go directly to moment
API.
as per the current moment.js docs, moment.locale() is deprecated (and produces warnings in the console). it should be replaced with updateLocale()
https://github.com/moment/moment/issues/3043#issuecomment-197017584