Sha256: 9d462f20345b1b4a52602ed4b6e8929432c022712ca0485b9456b403d3c986e1

Contents?: true

Size: 758 Bytes

Versions: 173

Compression:

Stored size: 758 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 ToIntegerOrInfinity = require('./ToIntegerOrInfinity');

// https://262.ecma-international.org/12.0/#sec-maketime

module.exports = function MakeTime(hour, min, sec, ms) {
	if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) {
		return NaN;
	}
	var h = ToIntegerOrInfinity(hour);
	var m = ToIntegerOrInfinity(min);
	var s = ToIntegerOrInfinity(sec);
	var milli = ToIntegerOrInfinity(ms);
	var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli;
	return t;
};

Version data entries

173 entries across 50 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/es-abstract/2021/MakeTime.js
immosquare-cleaner-0.1.60 node_modules/es-abstract/2022/MakeTime.js
immosquare-cleaner-0.1.60 node_modules/es-abstract/2024/MakeTime.js
immosquare-cleaner-0.1.60 node_modules/es-abstract/2023/MakeTime.js
immosquare-cleaner-0.1.59 node_modules/es-abstract/2024/MakeTime.js
immosquare-cleaner-0.1.59 node_modules/es-abstract/2021/MakeTime.js
immosquare-cleaner-0.1.59 node_modules/es-abstract/2022/MakeTime.js
immosquare-cleaner-0.1.59 node_modules/es-abstract/2023/MakeTime.js
immosquare-cleaner-0.1.58 node_modules/es-abstract/2022/MakeTime.js
immosquare-cleaner-0.1.58 node_modules/es-abstract/2023/MakeTime.js
immosquare-cleaner-0.1.58 node_modules/es-abstract/2021/MakeTime.js
immosquare-cleaner-0.1.58 node_modules/es-abstract/2024/MakeTime.js
immosquare-cleaner-0.1.57 node_modules/es-abstract/2021/MakeTime.js
immosquare-cleaner-0.1.57 node_modules/es-abstract/2022/MakeTime.js
immosquare-cleaner-0.1.57 node_modules/es-abstract/2023/MakeTime.js
immosquare-cleaner-0.1.57 node_modules/es-abstract/2024/MakeTime.js
immosquare-cleaner-0.1.56 node_modules/es-abstract/2023/MakeTime.js
immosquare-cleaner-0.1.56 node_modules/es-abstract/2021/MakeTime.js
immosquare-cleaner-0.1.56 node_modules/es-abstract/2024/MakeTime.js
immosquare-cleaner-0.1.56 node_modules/es-abstract/2022/MakeTime.js