I\'d like the moment().fromNow() functionality, but when the date is close it is too precise - ex. I don\'t want it to show \'in 3 hours\' but \'today\' - so basica
moment().fromNow()
I use a combination of add() and endOf() with moment
add()
endOf()
//... const today = moment().endOf('day') const tomorrow = moment().add(1, 'day').endOf('day') if (date < today) return 'today' if (date < tomorrow) return 'tomorrow' return 'later' //...