0

I receive a beginning date for a live sport event and i want to calculate the minutes between this date and now, so i tried this with moment :

function(dateofevent) {
   var locale = window.navigator.userLanguage || window.navigator.language;
   var diff = moment(dateofevent).locale(locale).fromNow(true);
   return diff;
}

In a sense it works because it shows for example "12 minuts ago" or "2 hours ago" but i want a result only in minuts (128' for example). Is there a way to do that with moment ?

yoyojs
  • 1,723
  • 5
  • 24
  • 41

0 Answers0