title: angularjs - Set time using range slider
body: <p>I'm trying to use ionic range to set a period of time with a step of 15minutes.
  Ionic range works just like a common range input with min,max, step, value.</p>
  
  <p>Here's the range html code:</p>
  
  <pre><code>&lt;div class="item range"&gt;
    &lt;input type="range" min="0.15" max="12" value="0" step="0.15" ng-model="TimeValue" ng-change="setTime(TimeValue)"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And here's the function that i'm calling on change:</p>
  
  <pre><code>$scope.setTime = (value) -&gt;
     $scope.hours = Math.floor(value / 0.6);
     $scope.minutes = value - ($scope.hours * 0.6);
  </code></pre>
  
  <p>Unfortunately, this is not working.</p>
  
  <p>What I'm trying to achieve is a slider with a step of 0.15(minutes) that automatically creates an hour when it gets to 0.6 and than it starts again at 1.15(hours) and so on.</p>
  
  <p>I'm following this answer here: <a href="https://stackoverflow.com/questions/26750226/using-ionic-range-to-set-months-and-years">using ionic range to set months and years</a> but that's for years and months and the calculation is different.</p>
  
  <p>Here's a quick demo: <a href="http://codepen.io/anon/pen/eZVPRv?editors=1010" rel="nofollow noreferrer">http://codepen.io/anon/pen/eZVPRv?editors=1010</a></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>New demo: <a href="http://codepen.io/anon/pen/eZVPRv?editors=1010" rel="nofollow noreferrer">http://codepen.io/anon/pen/eZVPRv?editors=1010</a></p>