moment has no exported member 'MomentLanguage'

169 views Asked by At

I'm using moment v 2.15.2 with angular2 and I have this code

  import { MomentLanguage } from 'moment';
  import * as moment from 'moment';

  moment.updateLocale('ar', <MomentLanguage>{
    preparse: (str) => {
        return str.replace(/\u200f/g, '');
    },
    postformat: (str) => {
        return str;
    }
  });

It used to work fine, and today it's giving me this error "moment has no exported member 'MomentLanguage'".

I'm not sure if it is a version issue that they removed the module or not. I checked the moments docs http://momentjs.com/docs/#/i18n in the Accessing locale specific functionality section, and its kinda done differently.

What I want to achieve is converting the Arabic numbers into Latin numbers.

I appreciate any help.

0

There are 0 answers