siddii / angular-timer

re-usable/inter-operable AngularJS timer directive ⛺
http://siddii.github.io/angular-timer/
MIT License
793 stars 939 forks source link

It should be handle by the user's application itself #209

Open FDiskas opened 9 years ago

FDiskas commented 9 years ago

Yes please remove this as fast as posible

moment.locale(this.language);

https://github.com/siddii/angular-timer/blob/v1.3.4/dist/angular-timer.js#L378

FDiskas commented 9 years ago

This bug forces my all application to change the locale. You probably did something wrong with fallback language.

polomarcus commented 9 years ago

Hi @FDiskas,

Could you explain a bit more

This bug forces my all application to change the locale

Have you seen supported languages ? https://github.com/EvanHahn/HumanizeDuration.js#supported-languages Feel free to make a PR to HumanizeDuration to add your language :)

The fallback language is English, for information.

FDiskas commented 9 years ago

Befor application is running I'm setting the moment.locale(lt); and then your plugin is reseting this to EN locale. Thats wrong :)

yacuzo commented 8 years ago

I have the same problem with norwegian, which IS supported by humanizeDuration. Norwegian have a different abbreviation in humanizeDuration and moment, this is probably the case for other languages too. You can not trust two libraries to have the same abbreviations. Why do you even set the language of moment? I can not find anywhere in your code where you use any moment function which uses current language.

I find it strange that you do not think it is very bad for an angular module change global settings of a different library. Especially for something as common as moment.

Please remove this.

SBD580 commented 8 years ago

+1

MartinNuc commented 8 years ago

This cost us a lot of time to find out. It should be really removed or at least detect if moment locale is really en (moment.locale())

Pirozek commented 8 years ago

+1 remove it please

mzaarour commented 8 years ago

+1