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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var $Date = GetIntrinsic('%Date%');
|
---|
| 6 |
|
---|
[79a0317] | 7 | var $isFinite = require('math-intrinsics/isFinite');
|
---|
| 8 | var abs = require('math-intrinsics/abs');
|
---|
[d565449] | 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 | }
|
---|
[79a0317] | 18 | return +new $Date(ToNumber(time));
|
---|
[d565449] | 19 | };
|
---|
| 20 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.