moment from now javascript code example
Example 1: moment js from now
moment(date).fromNow();
Example 2: moment to javascript date
let now = moment()
let now = now.toDate()
moment(date).fromNow();
let now = moment()
let now = now.toDate()