jalaali / moment-jalaali

A Jalaali (Jalali, Persian, Khorshidi, Shamsi) calendar system plugin for moment.js.
MIT License
938 stars 162 forks source link

How to compare jalaali persian dates #258

Closed 1mehdifaraji closed 5 months ago

1mehdifaraji commented 8 months ago

I'm trying to use the isAfter function but I always get false from it:

moment("۱۴۰۲/۱۲/۲۷").isAfter("۱۴۰۲/۱۲/۲۲");

How can I use isAfter and compare jalaali dates ? Thanks in advance. @behrang

behrang commented 5 months ago

Something like this:

moment('1402/12/27', 'jYYYY/jMM/jDD').isAfter(moment('1402/12/22', 'jYYYY/jMM/jDD'))