31
rated 0 times
[
38]
[
7]
/ answers: 1 / hits: 11539
/ 3 Years ago, fri, july 9, 2021, 12:00:00
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?
More From » momentjs