title: Jquery slider. Two digits on minutes
body: <p>I have jquery slider and I want to select time from to. But minutes from 0-9 showing as <code>13:7</code> but not <code>13:07</code></p>
  
  <pre><code>jQuery(function() {
      jQuery('#slider-time').slider({
          range: true,
          min: 300,
          max: 1280,
          step: 1,
          values: [ 300, 793 ],
          slide: function( event, ui ) {
              var hours1 = Math.floor(ui.values[0] / 60);
              var minutes1 = ui.values[0] - (hours1 * 60);
  
              if(hours1.length &lt; 10) {hours1= '0' + hours};
              if(minutes1.length &lt; 10) {minutes1 = '0' + minutes};
  
              if(minutes1 == 0) minutes1 = '00';
  
              var hours2 = Math.floor(ui.values[1] / 60);
              var minutes2 = ui.values[1] - (hours2 * 60);
  
              if(hours2.length &lt; 10) {hours2= '0' + hours};
              if(minutes2.length &lt; 10) {minutes2 = '0' + minutes};
  
              if(minutes2 == 0) minutes2 = '00';
  
              jQuery('#amount-stop').val(hours1+':'+minutes1 );
              jQuery('#amount-start').val(hours2+':'+minutes2 );
          }
      });
  });
  </code></pre>