title: Subtracting values to moment.js using input[type="range"]
body: <p>I want to subtract dates to <a href="http://momentjs.com/" rel="nofollow">moment.js</a> using input[type="range"] but it's not working correctly. Here is my code:</p>
  
  <p>JS</p>
  
  <pre><code>&lt;input type="range" min="1" max="30"&gt;
  &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="moment.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  &lt;script&gt;
  var now = moment().format('MMM DD, YYYY - hh:mm a');
  
  $('input[type="range"]').on('change',function(){
  
      var timeValue = $(this).val();
  
      now = moment().subtract(timeValue,'minutes').format("MMM DD, YYYY - hh:mm a");
      console.log(timeValue);
      console.log(now);
  
  });
  &lt;/script&gt;
  </code></pre>