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

check momentObj in isJalali func #56

Closed rzkhosroshahi closed 5 years ago

rzkhosroshahi commented 5 years ago

I changed isJalali function and just check momentObj. I test it in my project and solved this #55

fingerpich commented 5 years ago

I think its better to be written like

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

and also please test it and make sure of it passes the tests.

rzkhosroshahi commented 5 years ago

I think its better to be written like

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

and also please test it and make sure of it passes the tests.

Hi, thanks. I run tests in my machine everything is ok. but I don't know what happens in travis that two tests are failed.

fingerpich commented 5 years ago

Thanks, It's already published as 3.3.1.