jalaali / moment-jalaali

A Jalaali (Jalali, Persian, Khorshidi, Shamsi) calendar system plugin for moment.js.
MIT License
932 stars 161 forks source link

error : Cannot read property 'humanize' of undefined #151

Open MN767 opened 6 years ago

MN767 commented 6 years ago

I'm using "moment-jalaali": "^0.7.4" When I use moment.loadPersian({dialect: 'persian-modern'}) , I make a mistake error: Cannot read property 'humanize' of undefined my code:

import moment from 'moment-jalaali';
moment.loadPersian({dialect: 'persian-modern'});
...
    new moment().fromNow()
...
MN767 commented 6 years ago

I think your problem is for updating moment Please read page https://www.npmjs.com/package/moment of section Upgrading to 2.0.0

mrsoftware commented 6 years ago

I have the same problem.

behrang commented 6 years ago

Couldn't reproduce this. Can you run npm test in a checked out directory and send the results?

MN767 commented 6 years ago

@mrsoftware downgrade to "moment-jalaali": "^0.5.1" to solve the problem