MCPcopy Index your code
hub / github.com/feiyu563/PrometheusAlert / getSetOffset

Function getSetOffset

static/plugins/chart.js/Chart.bundle.js:17595–17631  ·  view source on GitHub ↗
(input, keepLocalTime, keepMinutes)

Source from the content-addressed store, hash-verified

17593 // _changeInProgress == true case, then we have to adjust, because
17594 // there is no such time in the given timezone.
17595 function getSetOffset (input, keepLocalTime, keepMinutes) {
17596 var offset = this._offset || 0,
17597 localAdjust;
17598 if (!this.isValid()) {
17599 return input != null ? this : NaN;
17600 }
17601 if (input != null) {
17602 if (typeof input === 'string') {
17603 input = offsetFromString(matchShortOffset, input);
17604 if (input === null) {
17605 return this;
17606 }
17607 } else if (Math.abs(input) < 16 && !keepMinutes) {
17608 input = input * 60;
17609 }
17610 if (!this._isUTC && keepLocalTime) {
17611 localAdjust = getDateOffset(this);
17612 }
17613 this._offset = input;
17614 this._isUTC = true;
17615 if (localAdjust != null) {
17616 this.add(localAdjust, 'm');
17617 }
17618 if (offset !== input) {
17619 if (!keepLocalTime || this._changeInProgress) {
17620 addSubtract(this, createDuration(input - offset, 'm'), 1, false);
17621 } else if (!this._changeInProgress) {
17622 this._changeInProgress = true;
17623 hooks.updateOffset(this, true);
17624 this._changeInProgress = null;
17625 }
17626 }
17627 return this;
17628 } else {
17629 return this._isUTC ? offset : getDateOffset(this);
17630 }
17631 }
17632
17633 function getSetZone (input, keepLocalTime) {
17634 if (input != null) {

Callers

nothing calls this directly

Calls 4

offsetFromStringFunction · 0.85
getDateOffsetFunction · 0.85
addSubtractFunction · 0.85
createDurationFunction · 0.85

Tested by

no test coverage detected