readableTimeCompact = function (ms) {
  if (isNaN(ms)) { return '?'; }

  const hours = parseInt((ms / (1000 * 60 * 60)) % 24);
  const days = parseInt((ms / (1000 * 60 * 60 * 24)));

  let result = '';

  if (days) {
    result += days + 'd ';
  }
  result += hours + 'h';
  return result;
}
Turns milliseconds into a human readable time range

@example
'{{ 1524680821790 | readableTime }}'
this.$options.filters.readableTimeCompact(1524680821790);

@param {int} ms    The time in ms from epoch
@returns {string}  The human readable time range
                   Output example: 1 day 10:42:01