arshaw / xdate

A Modern JavaScript Date Library
http://arshaw.com/xdate/
GNU General Public License v2.0
681 stars 81 forks source link

date diff requirement #23

Closed lahvey closed 11 years ago

lahvey commented 11 years ago

Currently date diff returns the float diff values. But it's not easy to tell if two date are in the same year/month/day. Is there any better way to test it? For example: var d1 = new XDate(2013, 8, 1); var d2 = new XDate(2012, 9, 1); d1.diffYear(d2); // same year, so return 0; d1.diffMonth(d2); // return 1

Knowing that you are focusing on fullcal, I take back my requirement. XDate is still a power full lib. Thank you very much.