Closed MahdiMahzouni closed 8 years ago
You can use jDaysInMonth
. It was not documented. Added an example of it to the documentation.
moment.jDaysInMonth(1395, 11) // 30
moment.jDaysInMonth(1394, 11) // 29
There is bug here ...
moment('1399/1/10', 'jYYYY/jM/jD').daysInMonth() ---> Output : 31
moment('1399/2/10', 'jYYYY/jM/jD').daysInMonth() ---> Output : 30
!!!
moment('1399/12/10', 'jYYYY/jM/jD').daysInMonth() ---> Output: 28
!!!
daysInMonth
returns number of days in a Gregorian month. You may use moment.jDaysInMonth(1399, 0)
to get the number of days in a specific Jalaali month. Note that months are 0-based.
daysInMonth
returns number of days in a Gregorian month. You may usemoment.jDaysInMonth(1399, 0)
to get the number of days in a specific Jalaali month. Note that months are 0-based.
Thanks!
Actual Behaviour : Right now when you call the daysInMonth method on a jalaali date it returns the maximum days of the Gregorian months ex. 31 and 30 or 28 . Appropriate Behaviour would be to return the correct days in Shamsi Calender like 31 and 30 for first half and last half of the year and 29 for the last month where the year is a leap year.