fingerpich / jalali-moment

Display, parse, manipulate, validate and convert jalali (Persian, Khorshidi, Shamsi) or Gregorian (Miladi) dates and times.
https://fingerpich.github.io/jalali-moment/
MIT License
436 stars 68 forks source link

Uncaught TypeError: Cannot read property 'calSystem' of undefined #55

Closed rzkhosroshahi closed 5 years ago

rzkhosroshahi commented 5 years ago

Describe the bug After bundling my package into dist file. when I used npm link to test package I got an error: TypeError: Cannot read property 'calSystem' of undefined. this decelered in jalali-moment module.

fingerpich commented 5 years ago

Hi,

The error is thrown in the line

return momentObj.calSystem === 1 || (moment.justUseJalali && momentObj.calSystem !== 2);

I didn't check your package but as we see here the momentObj is undefined and even if we handle this problem you would have another problem. Please check it and find the exact problem and feel free to create a pull request

fingerpich commented 5 years ago

Fixed in #56