xsoh / moment-hijri

A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js
http://momentjs.com/docs/#/plugins/hijri/
MIT License
200 stars 82 forks source link

Illogical return from isSame() #73

Closed mazenadel19 closed 1 year ago

mazenadel19 commented 2 years ago

Description: comparing 1443/11/01 to 1443/10/01 returns true also it should return false

Steps to replicate the bug: moment('1443/11/01', 'iYYYY/iMM/iDD').isSame(moment('1443/10/01', 'iYYYY/iMM/iDD'),'month')

diana96alazzam commented 1 year ago

Use iMonth instead of month.

moment('1443/11/01', 'iYYYY/iMM/iDD').isSame(moment('1443/10/01', 'iYYYY/iMM/iDD'),'iMonth')

mazenadel19 commented 1 year ago

Hmm, I think you're correct, I'm not sure why I used month instead of iMonth then 🤔 To my surprise, I tested isSame with month and iMonth and I found that it is returning false in both cases now. I will go ahead and close this issue. Thanks for your help!