plugins/timepicker/bootstrap-timepicker.js
function (segment, step) {
      if (segment % step === 0) {
        return segment;
      }
      if (Math.round((segment % step) / step)) {
        return (segment + (step - segment % step)) % 60;
      } else {
        return segment - segment % step;
      }
    }
function (segment, step) {
      if (segment % step === 0) {
        return segment;
      }
      if (Math.round((segment % step) / step)) {
        return (segment + (step - segment % step)) % 60;
      } else {
        return segment - segment % step;
      }
    }
function ( segment , step ) { if ( segment % step === 0 ) { return segment ; } if ( Math . round ( ( segment % step ) / step ) ) { return ( segment + ( step - segment % step ) ) % 60 ; } else { return segment - segment % step ; } }
Given a segment value like 43, will round and snap the segment
to the nearest "step", like 45 if step is 15. Segment will
"overflow" to 0 if it's larger than 59 or would otherwise
round up to 60.
Given a segment value like 43 will round and snap the segment to the nearest step like 45 if step is 15 . Segment will overflow to 0 if it s larger than 59 or would otherwise round up to 60 .