As moment is deprecated, I decided to stash moment from my entire project and thinking to use datefns as a replacement. While I was going through the code file, I came across a line which is saying,
moment(date1).isSameOrBefore(date2, year);
I started looking for something that is similar to what that function is doing but unfortunately, date-fns doesn't have anything to perform precision-based comparison (i.e: year, month or date comparison)? Can anyone suggest some workaround with date-fns?