lib/date.js
function getAdjustedUnit(ms, fn) {
  var unitIndex = 0, value = 0;
  iterateOverDateUnits(function(unit, i) {
    value = abs(fn(unit));
    if (value >= 1) {
      unitIndex = i;
      return false;
    }
  });
  return [value, unitIndex, ms];
}
function getAdjustedUnit(ms, fn) {
  var unitIndex = 0, value = 0;
  iterateOverDateUnits(function(unit, i) {
    value = abs(fn(unit));
    if (value >= 1) {
      unitIndex = i;
      return false;
    }
  });
  return [value, unitIndex, ms];
}
function getAdjustedUnit ( ms , fn ) { var unitIndex = 0 , value = 0 ; iterateOverDateUnits ( function ( unit , i ) { value = abs ( fn ( unit ) ) ; if ( value >= 1 ) { unitIndex = i ; return false ; } } ) ; return [ value , unitIndex , ms ] ; }
Gets an "adjusted date unit" which is a way of representing the largest possible meaningful unit. In other words, if passed 3600000, this will return an array which represents "1 hour".
Gets an adjusted date unit which is a way of representing the largest possible meaningful unit . In other words if passed 3600000 this will return an array which represents 1 hour .