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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
[79a0317] | 3 | var $isFinite = require('math-intrinsics/isFinite');
|
---|
| 4 |
|
---|
[d565449] | 5 | var timeConstants = require('../helpers/timeConstants');
|
---|
| 6 | var msPerSecond = timeConstants.msPerSecond;
|
---|
| 7 | var msPerMinute = timeConstants.msPerMinute;
|
---|
| 8 | var msPerHour = timeConstants.msPerHour;
|
---|
| 9 |
|
---|
| 10 | var ToInteger = require('./ToInteger');
|
---|
| 11 |
|
---|
| 12 | // https://262.ecma-international.org/5.1/#sec-15.9.1.11
|
---|
| 13 |
|
---|
| 14 | module.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.