MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / toISOString

Function toISOString

static/plugins/chart.js/Chart.bundle.js:18035–18053  ·  view source on GitHub ↗
(keepOffset)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

formatMomentFunction · 0.85
isFunctionFunction · 0.70

Tested by

no test coverage detected