Sha256: f91ad37ec6587e1debbe2be4f1bb86f4936df8e4649af2e33fe14023ed9f6da7
Contents?: true
Size: 698 Bytes
Versions: 315
Compression:
Stored size: 698 Bytes
Contents
'use strict'; var $isFinite = require('../helpers/isFinite'); var timeConstants = require('../helpers/timeConstants'); var msPerSecond = timeConstants.msPerSecond; var msPerMinute = timeConstants.msPerMinute; var msPerHour = timeConstants.msPerHour; var ToInteger = require('./ToInteger'); // https://262.ecma-international.org/5.1/#sec-15.9.1.11 module.exports = function MakeTime(hour, min, sec, ms) { if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { return NaN; } var h = ToInteger(hour); var m = ToInteger(min); var s = ToInteger(sec); var milli = ToInteger(ms); var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; return t; };
Version data entries
315 entries across 44 versions & 4 rubygems