MinFromTime.js 396 B

1234567891011121314
  1. 'use strict';
  2. var floor = require('./floor');
  3. var modulo = require('./modulo');
  4. var timeConstants = require('../helpers/timeConstants');
  5. var msPerMinute = timeConstants.msPerMinute;
  6. var MinutesPerHour = timeConstants.MinutesPerHour;
  7. // https://262.ecma-international.org/5.1/#sec-15.9.1.10
  8. module.exports = function MinFromTime(t) {
  9. return modulo(floor(t / msPerMinute), MinutesPerHour);
  10. };