main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
468 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var $Date = GetIntrinsic('%Date%');
|
---|
| 6 | var $Number = GetIntrinsic('%Number%');
|
---|
| 7 |
|
---|
| 8 | var $isFinite = require('../helpers/isFinite');
|
---|
| 9 |
|
---|
| 10 | var abs = require('./abs');
|
---|
| 11 | var ToNumber = require('./ToNumber');
|
---|
| 12 |
|
---|
| 13 | // https://262.ecma-international.org/5.1/#sec-15.9.1.14
|
---|
| 14 |
|
---|
| 15 | module.exports = function TimeClip(time) {
|
---|
| 16 | if (!$isFinite(time) || abs(time) > 8.64e15) {
|
---|
| 17 | return NaN;
|
---|
| 18 | }
|
---|
| 19 | return $Number(new $Date(ToNumber(time)));
|
---|
| 20 | };
|
---|
| 21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.