相关文章推荐

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date1.isAfter(date2, {inclusive: true}) returns true if date1 == date2.

Removes the need to do something like:

date1.isSame(date2) || date1.isAfter(date2)

One thing about Moment's interface is that its functions don't generally take option objects. I'm not sure why that is, but it would be weird to start introducing them for a case like this. Beyond that, I think this a marginal case to begin with, since date1.isSame(date2) || date1.isAfter(date2) is in some ways clearer and only a bit longer. So unless @ichernev disagrees, I think we'll pass on this.

rbriank, ismusidhu, savoiebz, Wingjam, seanfmcd, tadeusgregorian, andreihaiducu, fdagostini, GitClickOk, danielwong2268, and bendoc1996 reacted with thumbs up emoji jvercaemer and ksuvot reacted with heart emoji All reactions
 
推荐文章