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:
439 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var GetIntrinsic = require('get-intrinsic');
|
---|
4 |
|
---|
5 | var $Date = GetIntrinsic('%Date%');
|
---|
6 |
|
---|
7 | var $isFinite = require('math-intrinsics/isFinite');
|
---|
8 | var abs = require('math-intrinsics/abs');
|
---|
9 |
|
---|
10 | var ToNumber = require('./ToNumber');
|
---|
11 |
|
---|
12 | // https://262.ecma-international.org/5.1/#sec-15.9.1.14
|
---|
13 |
|
---|
14 | module.exports = function TimeClip(time) {
|
---|
15 | if (!$isFinite(time) || abs(time) > 8.64e15) {
|
---|
16 | return NaN;
|
---|
17 | }
|
---|
18 | return +new $Date(ToNumber(time));
|
---|
19 | };
|
---|
20 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.