title: How do I limit my moment js duration values to only 2 digits?
body: <p>I am using <a href="https://momentjs.com/" rel="nofollow noreferrer">moment.js</a> to work with date times which are calculated from distance/speed.  I am also using the <a href="https://github.com/jsmreese/moment-duration-format" rel="nofollow noreferrer">moment duration format plugin</a>.  When I pass the value to <code>moment.duration</code> and then format it some of the values are more than 2 digits, i.e.</p>
  
  <pre><code>39:3452:98762
  </code></pre>
  
  <p>I would like this to format correctly as <code>HH:mm:ss</code>.  Here is my code.</p>
  
  <pre><code>var point1Time = 19.188019795;
  var d1 = moment.duration(point1Time, 'hours');
  
  var d1Hours = d1.format('HH');
  var d1Mins = d1.format('mm', {forceLength: true });
  var d1Secs = d1.format('ss', {forceLength: true });
  </code></pre>
  
  <p>As you can see the <code>point1Time</code> (which I've entered as a number for the sake of this example) is miles/speed, I then pass this value to <code>moment</code> as a <code>duration</code> in <code>hours</code>.  After that I try to separate the <code>HH:mm:ss</code> using <code>format</code>.  The value that is returned is something like <code>d1Hours: 19</code>, <code>d1Mins: 1151</code>, <code>d1Secs: 69076</code>.  </p>
  
  <p>I thought that adding <code>forceLength</code> would help keep the digits down to two only but it didn't work as I can't see where to define that limit.  </p>
  
  <p>Can anyone assist with this?</p>