Fixed linting errors

This commit is contained in:
danielyxie 2018-09-12 11:19:59 -05:00
parent d50c5abb66
commit a18a2e8e70
2 changed files with 10 additions and 5 deletions

@ -14,13 +14,18 @@ import 'numeral/locales/no';
import 'numeral/locales/pl';
import 'numeral/locales/ru';
/* eslint-disable class-methods-use-this */
class NumeralFormatter {
constructor() {
this.defaultLocale = 'en';
}
updateLocale(l) {
if (numeral.locale(l) == null) {
console.warn(`Invalid locale for numeral: ${l}`);
let defaultValue = 'en';
numeral.locale(defaultValue);
numeral.locale(this.defaultLocale);
return false;
}
return true;