MCPcopy Index your code
hub / github.com/csev/py4e / getSetOffset

Function getSetOffset

code/gmane/Chart.bundle.js:3157–3188  ·  view source on GitHub ↗
(input, keepLocalTime)

Source from the content-addressed store, hash-verified

3155 // _changeInProgress == true case, then we have to adjust, because
3156 // there is no such time in the given timezone.
3157 function getSetOffset (input, keepLocalTime) {
3158 var offset = this._offset || 0,
3159 localAdjust;
3160 if (input != null) {
3161 if (typeof input === 'string') {
3162 input = offsetFromString(input);
3163 }
3164 if (Math.abs(input) < 16) {
3165 input = input * 60;
3166 }
3167 if (!this._isUTC && keepLocalTime) {
3168 localAdjust = getDateOffset(this);
3169 }
3170 this._offset = input;
3171 this._isUTC = true;
3172 if (localAdjust != null) {
3173 this.add(localAdjust, 'm');
3174 }
3175 if (offset !== input) {
3176 if (!keepLocalTime || this._changeInProgress) {
3177 add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
3178 } else if (!this._changeInProgress) {
3179 this._changeInProgress = true;
3180 utils_hooks__hooks.updateOffset(this, true);
3181 this._changeInProgress = null;
3182 }
3183 }
3184 return this;
3185 } else {
3186 return this._isUTC ? offset : getDateOffset(this);
3187 }
3188 }
3189
3190 function getSetZone (input, keepLocalTime) {
3191 if (input != null) {

Callers

nothing calls this directly

Calls 4

offsetFromStringFunction · 0.85
getDateOffsetFunction · 0.85
create__createDurationFunction · 0.85

Tested by

no test coverage detected