fingerpich/jalali-moment

jDaysInMonth is not working properly

Closed this issue · 1 comments

I assume that jDaysInMonth should return the jalali month length for the given date because there is no documentation for that.
steps to reproduce:
method 1:
(expect output = 29 but it returns 30)
output = moment.from('1398/12/01', 'fa', 'YYYY/MM/DD').jDaysInMonth();
but it work correctly for '1398/12/02'
or
(expect output = 31 but it returns 29)
output = moment('1398/01/01', 'jYYYY/jMM/jDD').jDaysInMonth();
but it work correctly for '1399/01/02'.

method 2:
(expected output = 29 but it always returns 31 on any input)
output = moment.jDaysInMonth(1398, 12);
thank you for great job.

Please create a demo
I have tested and all is working well, I will add the tests soon