BVB Source Codes

reactide Show es6.date.to-iso-string.js Source code

Return Download reactide: download es6.date.to-iso-string.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  2. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  3. var $export = require('./_export')
  4.   , fails   = require('./_fails')
  5.   , getTime = Date.prototype.getTime;
  6.  
  7. var lz = function(num){
  8.   return num > 9 ? num : '0' + num;
  9. };
  10.  
  11. // PhantomJS / old WebKit has a broken implementations
  12. $export($export.P + $export.F * (fails(function(){
  13.   return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
  14. }) || !fails(function(){
  15.   new Date(NaN).toISOString();
  16. })), 'Date', {
  17.   toISOString: function toISOString(){
  18.     if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
  19.     var d = this
  20.       , y = d.getUTCFullYear()
  21.       , m = d.getUTCMilliseconds()
  22.       , s = y < 0 ? '-' : y > 9999 ? '+' : '';
  23.     return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
  24.       '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
  25.       'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
  26.       ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
  27.   }
  28. });
downloades6.date.to-iso-string.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top