source: imaps-frontend/node_modules/es-abstract/2018/MakeTime.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 704 bytes
RevLine 
[d565449]1'use strict';
2
[79a0317]3var $isFinite = require('math-intrinsics/isFinite');
4
[d565449]5var timeConstants = require('../helpers/timeConstants');
6var msPerSecond = timeConstants.msPerSecond;
7var msPerMinute = timeConstants.msPerMinute;
8var msPerHour = timeConstants.msPerHour;
9
10var ToInteger = require('./ToInteger');
11
12// https://262.ecma-international.org/5.1/#sec-15.9.1.11
13
14module.exports = function MakeTime(hour, min, sec, ms) {
15 if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) {
16 return NaN;
17 }
18 var h = ToInteger(hour);
19 var m = ToInteger(min);
20 var s = ToInteger(sec);
21 var milli = ToInteger(ms);
22 var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli;
23 return t;
24};
Note: See TracBrowser for help on using the repository browser.