Interpreting the time
Here's a rewrite without any ifs:

function humanTime(minutes) {
  var units          = ['months' , 'weeks' , 'days' , 'hours'];
  var minutesPerUnit = [40320    , 10080   , 1440   , 60];
  var timeInUnits    = minutesPerUnit.map(x =&gt; Math.floor(minutes / x));
  var time           = timeInUnits.find(x =&gt; x &gt; 0);
  var unit           = units[timeInUnits.indexOf(time)];
  return time + ' ' + unit;
}


Note I removed the &lt;td&gt;s from this code as it's mainly a view (formatting) concern.  This allows this function to remain more focused: it simply takes a number of minutes and converts it to hours/days/weeks/months as appropriate.

You might also consider returning an object of the form: {time: 6, unit: 'days'} instead of a string as I have, to make the separation of data and view even stronger.