I've searching the moment.js docs and stackoverflow for a way to use the fromNow()
function but returning everything in hours.
What I mean is:
moment([2017, 01, 05]).fromNow(); // a day ago
should be
moment([2017, 01, 05]).fromNow(); // 24 hours ago
I know it's possible to do this using .diff
and probably other similar functions and then adding the text, but is it possible to use .fromNow()
to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…