(keepOffset)
| 18033 | } |
| 18034 | |
| 18035 | function toISOString(keepOffset) { |
| 18036 | if (!this.isValid()) { |
| 18037 | return null; |
| 18038 | } |
| 18039 | var utc = keepOffset !== true; |
| 18040 | var m = utc ? this.clone().utc() : this; |
| 18041 | if (m.year() < 0 || m.year() > 9999) { |
| 18042 | return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); |
| 18043 | } |
| 18044 | if (isFunction(Date.prototype.toISOString)) { |
| 18045 | // native implementation is ~50x faster, use it when we can |
| 18046 | if (utc) { |
| 18047 | return this.toDate().toISOString(); |
| 18048 | } else { |
| 18049 | return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); |
| 18050 | } |
| 18051 | } |
| 18052 | return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); |
| 18053 | } |
| 18054 | |
| 18055 | /** |
| 18056 | * Return a human readable representation of a moment that can |
nothing calls this directly
no test coverage detected