Numeral-js icon indicating copy to clipboard operation
Numeral-js copied to clipboard

Change instance language / locale locally

Open ragulka opened this issue 13 years ago • 6 comments

I wonder whether something like this is possible with Numeral? It is something that I need to use in an app that I am building.

ragulka avatar Nov 22 '13 12:11 ragulka

Yes, this would be very helpful for me so count my vote to do this too. :+1 :)

AtomicAlienZ avatar Dec 10 '13 13:12 AtomicAlienZ

This is kind of old, any thoughts on this? I was searching for a library with this feature. Maybe I could help to implement.

daltones avatar Nov 23 '16 03:11 daltones

This should have been in version 2 since it's breaking locale, it would be nice to have the locale stored in Numeral object and not globally. For an app with multiple users with different locales it sucks to always have to change local right before formatting..

dresende avatar Dec 20 '16 16:12 dresende

It's not necessary a breaking change. It could be just a new feature for v2.1.

I like the way Moment.js handles it.

// global
moment.locale('en');

// instance
moment('2016-12-20').locale('pt-br').[...]

daltones avatar Dec 20 '16 16:12 daltones

It's not necessary a breaking change. It could be just a new feature for v2.1.

I was talking about the breaking changes in 2.0.0. Since it breaked there, it could introduce it there.

I agree with you, I use moment and numeral and love how moment works.

dresende avatar Dec 20 '16 16:12 dresende

I want to use numeral for number parsing. Sometime, I need to assign particular locale when doing number parsing.

jazarja avatar Oct 13 '17 04:10 jazarja